|
From: Miguel N. <m....@fr...> - 2018-01-30 11:12:38
|
Hello Mathieu,
I am still struggling with the private tags. From another thread I am
trying to add to the private dictionary:
gdcm::Global gl;
gl.GetDicts().GetPrivateDict().AddDictEntry(gdcm::Tag(0x33431002),
gdcm::DictEntry("my float", "0x3343, 0x1002", gdcm::VR::DS, gdcm::VM::VM1));
AddTag(gdcm::Tag(0x33431002), gdcm::VR::DS, to_string(myfloatVal), nds);
But dcmdump still shows the ?? and strange values, instead of the float
I try to add.
I cannot edit the gdcm source file, as I must keep the code 100% original.
Here's the header of the DICOM File I produce, note the little endian
explicit/implicit:
# Dicom-Meta-Information-Header
# Used*TransferSyntax: Little Endian Explicit*
(0002,0000) UL 258 # 4, 1
FileMetaInformationGroupLength
(0002,0001) OB 00\01 # 2, 1
FileMetaInformationVersion
(0002,0002) UI =RTDoseStorage # 30, 1
MediaStorageSOPClassUID
(0002,0003) UI
[1.2.826.0.1.3680043.2.1125.1402728151637679963950600771425829278] #
64, 1 MediaStorageSOPInstanceUID
*(0002,0010) UI =LittleEndianImplicit # 18, 1
TransferSyntaxUID*
(0002,0012) UI
[1.2.826.0.1.3680043.2.1143.107.104.103.115.2.8.3.126.124.113] # 60, 1
ImplementationClassUID
(0002,0013) SH [GDCM 2.8.3] # 10, 1
ImplementationVersionName
(0002,0016) AE [GDCM/VTK 8.0.1] # 14, 1
SourceApplicationEntityTitle
(3343,1002) ?? 34\2e\30\30\30\30\30\30 # 8, 1
Unknown Tag & Data
Any suggestions?
Best regards,
Miguel
On 23-Jun-17 01:58 PM, Miguel Nunes wrote:
> Thank you Mathieu!
>
> Patch by hand doesnt seem the best option for me. How about
> private/public dictionaries?
> I mean using something like this:
>
> https://stackoverflow.com/questions/24943979/convert-a-dicom-tag-to-its-string-name-in-gdcm-in-c
>
>
> where it is possible to programaticaly add new Tags. I looked around
> but could not find exactly what I was looking for.
>
> Thanks again.
>
> Best regards,
> Miguel
>
> On 23-Jun-17 12:28 PM, Mathieu Malaterre wrote:
>> Hi Miguel,
>>
>> On Mon, Jun 19, 2017 at 1:49 PM, Miguel Nunes <m....@fr...>
>> wrote:
>>> Hello Mathieu,
>>>
>>> I am generating a volume with negative floating point pixels, and I am
>>> saving it using the same strategy found in RT Dose by using the
>>> doseGrid
>>> field. No issues there.
>>>
>>> However, I need to use private tags to save the paramenters that
>>> have to do
>>> with the calculation of the mentioned volume: bool, string, float and
>>> integer values. My issue is that I am having trouble saving these
>>> private
>>> tags. The examples I have found are not helping. For example, I
>>> would like
>>> to save these tags:
>>>
>>> (6501, 0000) UL <<SOME_VALUE>> # 4, 1 PrivateGroupLength
>>> (6501, 0010) LO [MY NEW DATASET] # 28, 1 PrivateCreator
>>> (6501, 1001) DS [3.0] # 8, 1
>>> Unknown Tag &
>>> Data
>>>
>>>
>>> But I am getting only:
>>> (6501, 0010) LO [MY NEW DATASET] # 28, 1
>>> PrivateCreator
>>> (6501, 1001) ?? 33\2e\30\30\30\30\30\30 # 8, 1 Unknown Tag &
>>> Data
>>>
>>>
>>> This is my code:
>>>
>>> AddTag(gdcm::Tag(0x65010010), gdcm::VR::LO, "MY NEW DATASET",
>>> mGdcmFileWriter.GetFile().GetDataSet());
>>> string val = "3.0";
>>> AddTag(gdcm::Tag(0x65011001), gdcm::VR::DS, val,
>>> mGdcmFileWriter.GetFile().GetDataSet());
>>>
>>>
>>> How do I get the VR to be recognized in the final DICOM file? how do I
>>> calculate the PrivateGroupLength ?
>> Do not use Implicit TS, and/or add your custom private tag to gdcm.
>> The easiest way is to patch gdcmPrivateDefaultDicts.cxx by hand.
>>
>>> Another question: is there any rule saying that these private tags
>>> should be
>>> inside a sequence?
>> Why would they need to be within a sequence ?
>>
>> http://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_7.8.html
>>
>>
>
>
> ------------------------------------------------------------------------------
>
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gdcm-developers mailing list
> Gdc...@li...
> https://lists.sourceforge.net/lists/listinfo/gdcm-developers
>
---
This email has been checked for viruses by AVG.
http://www.avg.com
|