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