Discussion:
[ITK-users] (no subject)
(too old to reply)
Harnish, Roy
2014-07-15 00:19:37 UTC
Permalink
Hi,

I'm wondering if there is a procedure for adding a dicom dictionary to those that are used by the GDCMImageIO, or a way to parse a private field by furnishing the pertinent info to the right method. I'm trying to access the field 0119,1030, which is pretty much a 3d version of ImageOrientationPatient. I have no problem seeing the field in a dcmdump of an image that contains the field, but am having trouble getting my program to handle the field properly. Here's what a dcmdump of the field looks like:

cbl-mbp-3369:Release rharnish$ dcmdump dce.dcm | grep -i imageor
(0020,0037) DS [-1\-0\0\-0\-1\0] # 16, 6 ImageOrientationPatient
cbl-mbp-3369:Release rharnish$ dcmdump dce.dcm | grep -i 0119,1030
(0119,1030) DS [-1\-0\0\-0\-1\0\0\0\1] # 22, 9 Unknown Tag & Data
cbl-mbp-3369:Release rharnish$

This is a section of code that tires to parse the field:

std::string tagkey = "0119|1030";
// std::string tagkey = "0020|0037";
std::string labelId;
std::string value;


if( gdcmImageIO->GetValueFromTag(tagkey, value) )
{
std::cout << tagkey << ": ";
std::cout << value << std::endl;
}

Here's the output with std::string tagkey = "0119|1030";:

0119|1030: LTFcLTBcMFwtMFwtMVwwXDBcMFwxIA==


Here's the output with std::string tagkey = "0020|0037";

0020|0037: -1\-0\0\-0\-1\0

Any suggestions would be much appreciated.
Matt McCormick
2014-07-15 01:02:41 UTC
Permalink
Hi Roy,

Does ccalling LoadPrivateTagsOn() [1] or LoadSequencesOn() [2] improve
the result?

Matt

[1] http://www.itk.org/Doxygen/html/classitk_1_1GDCMImageIO.html#a26ea3d5e85c0e6a7a614cbfbc05c4478

[2] http://www.itk.org/Doxygen/html/classitk_1_1GDCMImageIO.html#a7e81a44773f7daf85c6523866312372e

On Mon, Jul 14, 2014 at 8:19 PM, Harnish, Roy <Roy.Harnish-MULicn+***@public.gmane.org> wrote:
> Hi,
>
> I'm wondering if there is a procedure for adding a dicom dictionary to those
> that are used by the GDCMImageIO, or a way to parse a private field by
> furnishing the pertinent info to the right method. I'm trying to access the
> field 0119,1030, which is pretty much a 3d version of
> ImageOrientationPatient. I have no problem seeing the field in a dcmdump of
> an image that contains the field, but am having trouble getting my program
> to handle the field properly. Here's what a dcmdump of the field looks
> like:
>
> cbl-mbp-3369:Release rharnish$ dcmdump dce.dcm | grep -i imageor
> (0020,0037) DS [-1\-0\0\-0\-1\0] # 16, 6
> ImageOrientationPatient
> cbl-mbp-3369:Release rharnish$ dcmdump dce.dcm | grep -i 0119,1030
> (0119,1030) DS [-1\-0\0\-0\-1\0\0\0\1] # 22, 9 Unknown Tag
> & Data
> cbl-mbp-3369:Release rharnish$
>
> This is a section of code that tires to parse the field:
>
> std::string tagkey = "0119|1030";
> // std::string tagkey = "0020|0037";
> std::string labelId;
> std::string value;
>
>
> if( gdcmImageIO->GetValueFromTag(tagkey, value) )
> {
> std::cout << tagkey << ": ";
> std::cout << value << std::endl;
> }
>
> Here's the output with std::string tagkey = "0119|1030";:
>
> 0119|1030: LTFcLTBcMFwtMFwtMVwwXDBcMFwxIA==
>
>
> Here's the output with std::string tagkey = "0020|0037";
>
> 0020|0037: -1\-0\0\-0\-1\0
>
> Any suggestions would be much appreciated.
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users
>
> _______________________________________________
> Community mailing list
> Community-***@public.gmane.org
> http://public.kitware.com/mailman/listinfo/community
>
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users
Matt McCormick
2014-07-15 01:18:46 UTC
Permalink
Hi Roy,

Does calling GetLabelFromTag [1] return true?

Thanks,
Matt

[1] http://www.itk.org/Doxygen/html/classitk_1_1GDCMImageIO.html#adad2642a7dab4a896a8bf6afea6ff205

On Mon, Jul 14, 2014 at 9:08 PM, Harnish, Roy <Roy.Harnish-MULicn+***@public.gmane.org> wrote:
> Hi Matt,
>
> Thanks for getting back with me so quickly! I just tried turning both of those on, but I get the same result.
>
> Roy
>
>
> ________________________________________
> From: Matt McCormick [matt.mccormick-***@public.gmane.org]
> Sent: Monday, July 14, 2014 6:02 PM
> To: Harnish, Roy
> Cc: insight-users-***@public.gmane.org
> Subject: Re: [ITK] [ITK-users] (no subject)
>
> Hi Roy,
>
> Does ccalling LoadPrivateTagsOn() [1] or LoadSequencesOn() [2] improve
> the result?
>
> Matt
>
> [1] http://www.itk.org/Doxygen/html/classitk_1_1GDCMImageIO.html#a26ea3d5e85c0e6a7a614cbfbc05c4478
>
> [2] http://www.itk.org/Doxygen/html/classitk_1_1GDCMImageIO.html#a7e81a44773f7daf85c6523866312372e
>
> On Mon, Jul 14, 2014 at 8:19 PM, Harnish, Roy <Roy.Harnish-MULicn+***@public.gmane.org> wrote:
>> Hi,
>>
>> I'm wondering if there is a procedure for adding a dicom dictionary to those
>> that are used by the GDCMImageIO, or a way to parse a private field by
>> furnishing the pertinent info to the right method. I'm trying to access the
>> field 0119,1030, which is pretty much a 3d version of
>> ImageOrientationPatient. I have no problem seeing the field in a dcmdump of
>> an image that contains the field, but am having trouble getting my program
>> to handle the field properly. Here's what a dcmdump of the field looks
>> like:
>>
>> cbl-mbp-3369:Release rharnish$ dcmdump dce.dcm | grep -i imageor
>> (0020,0037) DS [-1\-0\0\-0\-1\0] # 16, 6
>> ImageOrientationPatient
>> cbl-mbp-3369:Release rharnish$ dcmdump dce.dcm | grep -i 0119,1030
>> (0119,1030) DS [-1\-0\0\-0\-1\0\0\0\1] # 22, 9 Unknown Tag
>> & Data
>> cbl-mbp-3369:Release rharnish$
>>
>> This is a section of code that tires to parse the field:
>>
>> std::string tagkey = "0119|1030";
>> // std::string tagkey = "0020|0037";
>> std::string labelId;
>> std::string value;
>>
>>
>> if( gdcmImageIO->GetValueFromTag(tagkey, value) )
>> {
>> std::cout << tagkey << ": ";
>> std::cout << value << std::endl;
>> }
>>
>> Here's the output with std::string tagkey = "0119|1030";:
>>
>> 0119|1030: LTFcLTBcMFwtMFwtMVwwXDBcMFwxIA==
>>
>>
>> Here's the output with std::string tagkey = "0020|0037";
>>
>> 0020|0037: -1\-0\0\-0\-1\0
>>
>> Any suggestions would be much appreciated.
>>
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.php
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/insight-users
>>
>> _______________________________________________
>> Community mailing list
>> Community-***@public.gmane.org
>> http://public.kitware.com/mailman/listinfo/community
>>
>
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users
Harnish, Roy
2014-07-15 01:27:21 UTC
Permalink
Hi Matt,

Here's what I'm running:

std::string tagkey = "0119|1030";
std::string labelId;
std::string value;
std::cout << "itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ): ";
std::cout << itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ) << std::endl;
std::cout << "labelId: " << labelId << std::endl;

And here's the output

itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ): 0
labelId:

Roy

________________________________________
From: Matt McCormick [matt.mccormick-***@public.gmane.org]
Sent: Monday, July 14, 2014 6:18 PM
To: Harnish, Roy; insight-users-***@public.gmane.org
Subject: Re: [ITK] [ITK-users] (no subject)

Hi Roy,

Does calling GetLabelFromTag [1] return true?

Thanks,
Matt

[1] http://www.itk.org/Doxygen/html/classitk_1_1GDCMImageIO.html#adad2642a7dab4a896a8bf6afea6ff205

On Mon, Jul 14, 2014 at 9:08 PM, Harnish, Roy <Roy.Harnish-MULicn+***@public.gmane.org> wrote:
> Hi Matt,
>
> Thanks for getting back with me so quickly! I just tried turning both of those on, but I get the same result.
>
> Roy
>
>
> ________________________________________
> From: Matt McCormick [matt.mccormick-***@public.gmane.org]
> Sent: Monday, July 14, 2014 6:02 PM
> To: Harnish, Roy
> Cc: insight-users-***@public.gmane.org
> Subject: Re: [ITK] [ITK-users] (no subject)
>
> Hi Roy,
>
> Does ccalling LoadPrivateTagsOn() [1] or LoadSequencesOn() [2] improve
> the result?
>
> Matt
>
> [1] http://www.itk.org/Doxygen/html/classitk_1_1GDCMImageIO.html#a26ea3d5e85c0e6a7a614cbfbc05c4478
>
> [2] http://www.itk.org/Doxygen/html/classitk_1_1GDCMImageIO.html#a7e81a44773f7daf85c6523866312372e
>
> On Mon, Jul 14, 2014 at 8:19 PM, Harnish, Roy <Roy.Harnish-MULicn+***@public.gmane.org> wrote:
>> Hi,
>>
>> I'm wondering if there is a procedure for adding a dicom dictionary to those
>> that are used by the GDCMImageIO, or a way to parse a private field by
>> furnishing the pertinent info to the right method. I'm trying to access the
>> field 0119,1030, which is pretty much a 3d version of
>> ImageOrientationPatient. I have no problem seeing the field in a dcmdump of
>> an image that contains the field, but am having trouble getting my program
>> to handle the field properly. Here's what a dcmdump of the field looks
>> like:
>>
>> cbl-mbp-3369:Release rharnish$ dcmdump dce.dcm | grep -i imageor
>> (0020,0037) DS [-1\-0\0\-0\-1\0] # 16, 6
>> ImageOrientationPatient
>> cbl-mbp-3369:Release rharnish$ dcmdump dce.dcm | grep -i 0119,1030
>> (0119,1030) DS [-1\-0\0\-0\-1\0\0\0\1] # 22, 9 Unknown Tag
>> & Data
>> cbl-mbp-3369:Release rharnish$
>>
>> This is a section of code that tires to parse the field:
>>
>> std::string tagkey = "0119|1030";
>> // std::string tagkey = "0020|0037";
>> std::string labelId;
>> std::string value;
>>
>>
>> if( gdcmImageIO->GetValueFromTag(tagkey, value) )
>> {
>> std::cout << tagkey << ": ";
>> std::cout << value << std::endl;
>> }
>>
>> Here's the output with std::string tagkey = "0119|1030";:
>>
>> 0119|1030: LTFcLTBcMFwtMFwtMVwwXDBcMFwxIA==
>>
>>
>> Here's the output with std::string tagkey = "0020|0037";
>>
>> 0020|0037: -1\-0\0\-0\-1\0
>>
>> Any suggestions would be much appreciated.
>>
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.php
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/insight-users
>>
>> _______________________________________________
>> Community mailing list
>> Community-***@public.gmane.org
>> http://public.kitware.com/mailman/listinfo/community
>>
>

_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users
Harnish, Roy
2014-07-15 01:31:22 UTC
Permalink
Correction:

Here's what I'm running:

std::string tagkey = "0119|1030";
std::string labelId;
std::string value;
std::cout << "gdcmImageIO->GetValueFromTag( tagkey, labelId ): ";
std::cout << gdcmImageIO->GetValueFromTag( tagkey, labelId ) << std::endl;
std::cout << "labelId: " << labelId << std::endl;

And here's the output:

gdcmImageIO->GetValueFromTag( tagkey, labelId ): 1
labelId: LTFcLTBcMFwtMFwtMVwwXDBcMFwxIA==


________________________________________
From: Insight-users [insight-users-bounces-***@public.gmane.org] on behalf of Harnish, Roy [Roy.Harnish-MULicn+***@public.gmane.org]
Sent: Monday, July 14, 2014 6:27 PM
To: Matt McCormick
Cc: insight-users-***@public.gmane.org
Subject: Re: [ITK-users] [ITK] (no subject)

Hi Matt,

Here's what I'm running:

std::string tagkey = "0119|1030";
std::string labelId;
std::string value;
std::cout << "itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ): ";
std::cout << itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ) << std::endl;
std::cout << "labelId: " << labelId << std::endl;

And here's the output

itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ): 0
labelId:

Roy

________________________________________
From: Matt McCormick [matt.mccormick-***@public.gmane.org]
Sent: Monday, July 14, 2014 6:18 PM
To: Harnish, Roy; insight-users-***@public.gmane.org
Subject: Re: [ITK] [ITK-users] (no subject)

Hi Roy,

Does calling GetLabelFromTag [1] return true?

Thanks,
Matt

[1] http://www.itk.org/Doxygen/html/classitk_1_1GDCMImageIO.html#adad2642a7dab4a896a8bf6afea6ff205

On Mon, Jul 14, 2014 at 9:08 PM, Harnish, Roy <Roy.Harnish-MULicn+***@public.gmane.org> wrote:
> Hi Matt,
>
> Thanks for getting back with me so quickly! I just tried turning both of those on, but I get the same result.
>
> Roy
>
>
> ________________________________________
> From: Matt McCormick [matt.mccormick-***@public.gmane.org]
> Sent: Monday, July 14, 2014 6:02 PM
> To: Harnish, Roy
> Cc: insight-users-***@public.gmane.org
> Subject: Re: [ITK] [ITK-users] (no subject)
>
> Hi Roy,
>
> Does ccalling LoadPrivateTagsOn() [1] or LoadSequencesOn() [2] improve
> the result?
>
> Matt
>
> [1] http://www.itk.org/Doxygen/html/classitk_1_1GDCMImageIO.html#a26ea3d5e85c0e6a7a614cbfbc05c4478
>
> [2] http://www.itk.org/Doxygen/html/classitk_1_1GDCMImageIO.html#a7e81a44773f7daf85c6523866312372e
>
> On Mon, Jul 14, 2014 at 8:19 PM, Harnish, Roy <Roy.Harnish-MULicn+***@public.gmane.org> wrote:
>> Hi,
>>
>> I'm wondering if there is a procedure for adding a dicom dictionary to those
>> that are used by the GDCMImageIO, or a way to parse a private field by
>> furnishing the pertinent info to the right method. I'm trying to access the
>> field 0119,1030, which is pretty much a 3d version of
>> ImageOrientationPatient. I have no problem seeing the field in a dcmdump of
>> an image that contains the field, but am having trouble getting my program
>> to handle the field properly. Here's what a dcmdump of the field looks
>> like:
>>
>> cbl-mbp-3369:Release rharnish$ dcmdump dce.dcm | grep -i imageor
>> (0020,0037) DS [-1\-0\0\-0\-1\0] # 16, 6
>> ImageOrientationPatient
>> cbl-mbp-3369:Release rharnish$ dcmdump dce.dcm | grep -i 0119,1030
>> (0119,1030) DS [-1\-0\0\-0\-1\0\0\0\1] # 22, 9 Unknown Tag
>> & Data
>> cbl-mbp-3369:Release rharnish$
>>
>> This is a section of code that tires to parse the field:
>>
>> std::string tagkey = "0119|1030";
>> // std::string tagkey = "0020|0037";
>> std::string labelId;
>> std::string value;
>>
>>
>> if( gdcmImageIO->GetValueFromTag(tagkey, value) )
>> {
>> std::cout << tagkey << ": ";
>> std::cout << value << std::endl;
>> }
>>
>> Here's the output with std::string tagkey = "0119|1030";:
>>
>> 0119|1030: LTFcLTBcMFwtMFwtMVwwXDBcMFwxIA==
>>
>>
>> Here's the output with std::string tagkey = "0020|0037";
>>
>> 0020|0037: -1\-0\0\-0\-1\0
>>
>> Any suggestions would be much appreciated.
>>
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.php
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/insight-users
>>
>> _______________________________________________
>> Community mailing list
>> Community-***@public.gmane.org
>> http://public.kitware.com/mailman/listinfo/community
>>
>

_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users

_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users
Matt McCormick
2014-07-15 01:39:41 UTC
Permalink
On Mon, Jul 14, 2014 at 9:27 PM, Harnish, Roy <Roy.Harnish-MULicn+***@public.gmane.org> wrote:
> Hi Matt,
>
> Here's what I'm running:
>
> std::string tagkey = "0119|1030";
> std::string labelId;
> std::string value;
> std::cout << "itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ): ";
> std::cout << itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ) << std::endl;
> std::cout << "labelId: " << labelId << std::endl;
>
> And here's the output
>
> itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ): 0
> labelId:
>

This means the tag is not found. For more information, try [1]

HTH,
Matt

[1] http://www.itk.org/Doxygen/html/IO_2DicomImageReadPrintTags_8cxx-example.html#_a2
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users
Harnish, Roy
2014-07-15 01:48:48 UTC
Permalink
Hi Matt,

I wasn't calling GetLabelFromTagWith the instance of GDCMImageIO that had been used to read the image. Here's what I get when I do that:

RUNNING:

std::string tagkey = "0119|1030";
std::string labelId;
std::string value;
std::cout << "gdcmImageIO->GetValueFromTag( tagkey, labelId ): ";
std::cout << gdcmImageIO->GetValueFromTag( tagkey, labelId ) << std::endl;
std::cout << "labelId: " << labelId << std::endl;

OUTPUT:

gdcmImageIO->GetValueFromTag( tagkey, labelId ): 1
labelId: LTFcLTBcMFwtMFwtMVwwXDBcMFwxIA==

So it looks like there is something returned by get value from tag.

Thanks for taking a look.

Roy

________________________________________
From: Matt McCormick [matt.mccormick-***@public.gmane.org]
Sent: Monday, July 14, 2014 6:39 PM
To: Harnish, Roy
Cc: insight-users-***@public.gmane.org
Subject: Re: [ITK] [ITK-users] (no subject)

On Mon, Jul 14, 2014 at 9:27 PM, Harnish, Roy <Roy.Harnish-MULicn+***@public.gmane.org> wrote:
> Hi Matt,
>
> Here's what I'm running:
>
> std::string tagkey = "0119|1030";
> std::string labelId;
> std::string value;
> std::cout << "itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ): ";
> std::cout << itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ) << std::endl;
> std::cout << "labelId: " << labelId << std::endl;
>
> And here's the output
>
> itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ): 0
> labelId:
>

This means the tag is not found. For more information, try [1]

HTH,
Matt

[1] http://www.itk.org/Doxygen/html/IO_2DicomImageReadPrintTags_8cxx-example.html#_a2

_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users
Harnish, Roy
2014-07-15 01:54:03 UTC
Permalink
One more iteration here with calls to both GetValueFromTag and GetLabelFromTag

CODE:

std::string tagkey = "0119|1030";
std::string labelId;
std::string value;

std::cout << "gdcmImageIO->GetValueFromTag( tagkey, labelId ): ";
std::cout << gdcmImageIO->GetValueFromTag( tagkey, value ) << std::endl;
std::cout << "value: " << value << std::endl;

std::cout << "gdcmImageIO->GetLabelFromTag( tagkey, labelId ): ";
std::cout << gdcmImageIO->GetLabelFromTag( tagkey, labelId ) << std::endl;
std::cout << "labelId: " << labelId << std::endl;

OUTPUT:

gdcmImageIO->GetValueFromTag( tagkey, labelId ): 1
value: LTFcLTBcMFwtMFwtMVwwXDBcMFwxIA==
gdcmImageIO->GetLabelFromTag( tagkey, labelId ): 0
labelId:


________________________________________
From: Harnish, Roy
Sent: Monday, July 14, 2014 6:48 PM
To: Matt McCormick
Cc: insight-users-***@public.gmane.org
Subject: RE: [ITK] [ITK-users] (no subject)

Hi Matt,

I wasn't calling GetLabelFromTagWith the instance of GDCMImageIO that had been used to read the image. Here's what I get when I do that:

RUNNING:

std::string tagkey = "0119|1030";
std::string labelId;
std::string value;
std::cout << "gdcmImageIO->GetValueFromTag( tagkey, labelId ): ";
std::cout << gdcmImageIO->GetValueFromTag( tagkey, labelId ) << std::endl;
std::cout << "labelId: " << labelId << std::endl;

OUTPUT:

gdcmImageIO->GetValueFromTag( tagkey, labelId ): 1
labelId: LTFcLTBcMFwtMFwtMVwwXDBcMFwxIA==

So it looks like there is something returned by get value from tag.

Thanks for taking a look.

Roy

________________________________________
From: Matt McCormick [matt.mccormick-***@public.gmane.org]
Sent: Monday, July 14, 2014 6:39 PM
To: Harnish, Roy
Cc: insight-users-***@public.gmane.org
Subject: Re: [ITK] [ITK-users] (no subject)

On Mon, Jul 14, 2014 at 9:27 PM, Harnish, Roy <Roy.Harnish-MULicn+***@public.gmane.org> wrote:
> Hi Matt,
>
> Here's what I'm running:
>
> std::string tagkey = "0119|1030";
> std::string labelId;
> std::string value;
> std::cout << "itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ): ";
> std::cout << itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ) << std::endl;
> std::cout << "labelId: " << labelId << std::endl;
>
> And here's the output
>
> itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ): 0
> labelId:
>

This means the tag is not found. For more information, try [1]

HTH,
Matt

[1] http://www.itk.org/Doxygen/html/IO_2DicomImageReadPrintTags_8cxx-example.html#_a2

_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users
Matt McCormick
2014-07-15 02:01:30 UTC
Permalink
On Mon, Jul 14, 2014 at 9:48 PM, Harnish, Roy <Roy.Harnish-MULicn+***@public.gmane.org> wrote:
> Hi Matt,
>
> I wasn't calling GetLabelFromTagWith the instance of GDCMImageIO that had been used to read the image.

Re-using the gdcmImageIO that was used to read the image will ensure
the MetaDataDictionary is populated. Also, turning on the option to
read private tags before reading the image is a good idea.

HTH,
Matt
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users
Harnish, Roy
2014-07-15 02:19:44 UTC
Permalink
Thanks. I'll continue to work with the same gdcmImageIO, and will use the read private tags option as well. In this particular case, I don't think there is a tag for the group and element I am trying to access (0119,1030). If I grep for both 0119 and 1030 in InsightToolkit-4.5.2/Modules/ThirdParty/GDCM/src/gdcm, I don't see anything (other than an entry I tried putting in privatedicts.xml):

cbl-mbp-3369:gdcm rharnish$ pwd
/Users/Shared/OSIAV/ITK/InsightToolkit-4.5.2/Modules/ThirdParty/GDCM/src/gdcm
cbl-mbp-3369:gdcm rharnish$ grep -R 0119 . | grep 1030
./Source/DataDictionary/privatedicts.xml: <entry owner="RoyHarnish" group="0119" element="1030" vr="DS" vm="9" name="DmiDirectionCosines"/>
cbl-mbp-3369:gdcm rharnish$

Roy

________________________________________
From: Matt McCormick [matt.mccormick-***@public.gmane.org]
Sent: Monday, July 14, 2014 7:01 PM
To: Harnish, Roy
Cc: insight-users-***@public.gmane.org
Subject: Re: [ITK] [ITK-users] (no subject)

On Mon, Jul 14, 2014 at 9:48 PM, Harnish, Roy <Roy.Harnish-MULicn+***@public.gmane.org> wrote:
> Hi Matt,
>
> I wasn't calling GetLabelFromTagWith the instance of GDCMImageIO that had been used to read the image.

Re-using the gdcmImageIO that was used to read the image will ensure
the MetaDataDictionary is populated. Also, turning on the option to
read private tags before reading the image is a good idea.

HTH,
Matt

_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users
Continue reading on narkive:
Loading...