<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
When I do it like your method, I will get the error:<BR>
<BR>
error C2027: use of undefined type 'gdcm::File'<BR>2> D:\ITKVTK\InsightToolkit-3.8.0\Utilities\gdcm\src\gdcmSerieHelper.h(32) : see declaration of 'gdcm::File'<BR>
<BR>
I already installed the extern gdcm, and set ITK_USE_SYSTEM_ON, modified<BR>
the cmakelist.txt<BR>
<BR>
OPTION(ITK_USE_SYSTEM_GDCM "Use an outside build of GDCM." OFF)<BR>MARK_AS_ADVANCED(ITK_USE_SYSTEM_GDCM)<BR>IF(ITK_USE_SYSTEM_GDCM)<BR> # If GDCM has already been found, make sure it is the one used to<BR> # build ITK.<BR> IF(WIN32 OR APPLE)<BR> STRING(TOLOWER "${GDCM_DIR}" ITK_CHECK_GDCM_DIR)<BR> STRING(TOLOWER "${ITK_GDCM_DIR}" ITK_CHECK_ITK_GDCM_DIR)<BR> ELSE(WIN32 OR APPLE)<BR> SET(ITK_CHECK_GDCM_DIR "${GDCM_DIR}")<BR> SET(ITK_CHECK_ITK_GDCM_DIR "${ITK_GDCM_DIR}")<BR> ENDIF(WIN32 OR APPLE)<BR> STRING(COMPARE EQUAL "${ITK_CHECK_GDCM_DIR}" "${ITK_CHECK_ITK_GDCM_DIR}"<BR> ITK_GDCM_DIR_MATCH)<BR> IF(GDCM_FOUND)<BR> IF(NOT ITK_GDCM_DIR_MATCH)<BR> MESSAGE(FATAL_ERROR<BR> "ITK was built with GDCM from \"${ITK_GDCM_DIR}\", "<BR> "but this project is using GDCM from \"${GDCM_DIR}\". "<BR> "Please set GDCM_DIR to match the one used to build ITK."<BR> )<BR> ENDIF(NOT ITK_GDCM_DIR_MATCH)<BR> ELSE(GDCM_FOUND)<BR> IF(GDCM_DIR)<BR> IF(NOT ITK_GDCM_DIR_MATCH)<BR> MESSAGE(<BR> "Warning: ITK was built with GDCM from \"${ITK_GDCM_DIR}\", "<BR> "but this project has set GDCM_DIR to \"${GDCM_DIR}\". "<BR> "ITK is changing GDCM_DIR to match the GDCM with which it was built."<BR> )<BR> ENDIF(NOT ITK_GDCM_DIR_MATCH)<BR> ENDIF(GDCM_DIR)<BR> SET(GDCM_DIR ${ITK_GDCM_DIR})<BR> FIND_PACKAGE(GDCM)<BR> IF(GDCM_FOUND)<BR> INCLUDE(${GDCM_USE_FILE})<BR> ELSE(GDCM_FOUND)<BR> MESSAGE(FATAL_ERROR<BR> "UseITK could not load GDCM settings from \"${GDCM_DIR}\" even through "<BR> "ITK was built using GDCM from this location."<BR> )<BR> ENDIF(GDCM_FOUND)<BR> ENDIF(GDCM_FOUND)<BR>ENDIF(ITK_USE_SYSTEM_GDCM)<BR>
<BR>
but I still get the error, when I include "gdcmFile.h", it indicates that <BR>
the system will use the internal gdcmFile.h in D:\ITKVTK\InsightToolkit-3.8.0\Utilities\gdcm\src\ not in the external path.<BR>
<BR>
How to solve this problem?<BR>
Thank you all again.<BR><BR>> Date: Tue, 16 Dec 2008 13:47:59 +0100<BR>> From: mathieu.malaterre@gmail.com<BR>> To: gjtian@hotmail.com<BR>> Subject: Re: [Insight-users] DICOM Header Info<BR>> CC: insight-users@itk.org<BR>> <BR>> [top-post mode]<BR>> <BR>> On Tue, Dec 16, 2008 at 1:01 PM, TienGarry <gjtian@hotmail.com> wrote:<BR>> > Thank you for your answer, this is the<BR>> > DictionaryType::ConstIterator end = dictionary.End();<BR>> > I am curious why I can get the patient weight correctly, but the following<BR>> > code can not<BR>> > get Radiopharmaceutical Start Time.<BR>> > entryId = "0018|1072";<BR>> > tagItr = dictionary.Find( entryId );<BR>> <BR>> Because both elements are not at the same level. See my previous email.<BR>> <BR>> > You mentioned that 0018,1072 is part of the sequence, and not part of the<BR>> > root element.<BR>> <BR>> correct<BR>> <BR>> > How can I get the value of this key entry, I need the information to<BR>> > calculate the SUV<BR>> > value of PET.<BR>> <BR>> gdcm::File *f = gdcm::File::New();<BR>> f->SetFileName( bla );<BR>> bool res = f->Load(); // handle res<BR>> <BR>> gdcm::SeqEntry *seq = f->GetSeqEntry(0x0054,0x0016);<BR>> gdcm::SQItem *sqi = seq->GetFirstSQItem();<BR>> while (sqi)<BR>> {<BR>> std::cout << sqi->GetEntryString(0x0018,0x1072) << std::endl;<BR>> sqi = seq->GetNextSQItem();<BR>> }<BR>> <BR>> 2cts<BR>> <BR>> > Thank you again.<BR>> ><BR>> ><BR>> >> Date: Tue, 16 Dec 2008 09:25:09 +0100<BR>> >> From: mathieu.malaterre@gmail.com<BR>> >> To: gjtian@hotmail.com<BR>> >> Subject: Re: [Insight-users] DICOM Header Info<BR>> >> CC: insight-users@itk.org<BR>> >><BR>> >> On Tue, Dec 16, 2008 at 5:31 AM, TienGarry <gjtian@hotmail.com> wrote:<BR>> >> > I want to retrieve some information from dicom header, for example I can<BR>> >> > get<BR>> >> > the patient weight correctly:<BR>> >> ><BR>> >> > entryId = "0010|1030";<BR>> >> > double patientweight = 0.;<BR>> >> > tagItr = dictionary.Find( entryId );<BR>> >> ><BR>> >> > but when I want to get the information like this, I can get the error<BR>> >> > inforamtion.<BR>> >> > entryId = "0018|1072";<BR>> >> > tagItr = dictionary.Find( entryId );<BR>> >> > if( tagItr == end )<BR>> >> > {<BR>> >> > std::cerr << "Tag " << entryId;<BR>> >> > std::cerr << " not found in the DICOM header" << std::endl;<BR>> >> > return EXIT_FAILURE;<BR>> >> > }<BR>> >><BR>> >><BR>> >> How did you defined 'end', do you mean dictionary.end() ? If so then<BR>> >> it should work (unless you are using VS6).<BR>> >><BR>> >> ><BR>> >> > The header ifor displayed in ImageJ like this:<BR>> >> ><BR>> >> > 0054,0013 Energy Window Range Sequence:<BR>> >> > 0054,0014 Energy Window Lower Limit: 350<BR>> >> > 0054,0015 Energy Window Upper Limit: 650<BR>> >> > 0054,0016 Radiopharmaceutical Information Sequence:<BR>> >> > 0018,1072 Radionuclide Start Time: 090748.000000<BR>> >> > 0018,1074 Radionuclide Total Dose: 370500000<BR>> >> > 0018,1075 Radionuclide Half Life: 6586.2<BR>> >> > 0018,1076 Radionuclide Positron Fraction: 0<BR>> >> > 0054,0300 Radionuclide Code Sequence:<BR>> >> > 0054,0081 Number of Slices: 262<BR>> >> > 0054,0410 Patient Orientation Code Sequence:<BR>> >> ><BR>> >><BR>> >> If I were you, I would not use ImageJ anymore. The output is clearly<BR>> >> not human readable. Looking at it you do not see that 0018,1072 is<BR>> >> part of the sequence, and not part of the root element. So it should<BR>> >> read:<BR>> >><BR>> >> 0054,0013 Energy Window Range Sequence:<BR>> >> 0054,0014 Energy Window Lower Limit: 350<BR>> >> 0054,0015 Energy Window Upper Limit: 650<BR>> >> 0054,0016 Radiopharmaceutical Information Sequence:<BR>> >> 0018,1072 Radionuclide Start Time: 090748.000000<BR>> >> 0018,1074 Radionuclide Total Dose: 370500000<BR>> >> 0018,1075 Radionuclide Half Life: 6586.2<BR>> >> 0018,1076 Radionuclide Positron Fraction: 0<BR>> >> 0054,0300 Radionuclide Code Sequence:<BR>> >> 0054,0081 Number of Slices: 262<BR>> >> 0054,0410 Patient Orientation Code Sequence<BR>> >><BR>> >> Indeed ITK-GDCM does not load Sequence in the MetaDataDictionary.<BR>> >><BR>> >> 2cts<BR>> >> --<BR>> >> Mathieu<BR>> ><BR>> > ________________________________<BR>> > MSN热搜榜全新升级,更多排行榜等着你! 立即查看!<BR>> <BR>> <BR>> <BR>> -- <BR>> Mathieu<BR><BR><br /><hr />MSN热搜榜全新升级,更多排行榜等着你! <a href=' http://top.msn.com.cn' target='_new'>立即查看!</a></body>
</html>