<div> Hi all,</div>
<div> I am using the internal gdcm (1.2 version) of the itk (3.12) to do dicom in out<br> application. Can anyone tell me why do I get the following error message?</div>
<div>Thanks.</div>
<div>Howard</div>
<div><br> 27>..\..\..\ITK3.12\Examples\IO\DicomImageReadWrite.cxx(56) : error C3861:<br> 'GetEntryValue': identifier not found<br> 27>..\..\..\ITK3.12\Examples\IO\DicomImageReadWrite.cxx(59) : error C2065:<br>
'GDCM_UNFOUND' : undeclared identifier<br> Bellow is is the code:</div>
<div><br> #include "itkImageFileReader.h"<br> #include "itkImageFileWriter.h"<br> #include "itkGDCMImageIO.h"<br> #include "gdcmFile.h"<br> #include <stdio.h> //sscanf<br>
#include "gdcmCommon.h"<br><br> int main( int argc, char* argv[] )<br> {<br> if( argc < 2 )<br> {<br> std::cerr << "Usage: " << std::endl;<br> std::cerr << argv[0] << " DicomImage OutputDicomImage ";<br>
return EXIT_FAILURE;<br> }<br><br> typedef unsigned int InputPixelType;<br> const unsigned int InputDimension = 3;<br><br> typedef itk::Image< InputPixelType, InputDimension > InputImageType;<br>
typedef itk::ImageFileReader< InputImageType > ReaderType;<br><br> gdcm::File *f1;<br> f1->SetFileName( argv[1] );<br> f1->Load();<br><br> int linesNumber = f1->GetYSize();<br> int rawsNumber = f1->GetXSize();<br>
int framesNumber = f1->GetZSize();// defaulted to 1 if not found<br><br> std::cout << "lines : " << linesNumber << " columns : " << rawsNumber<br> << " frames : " << framesNumber << std::endl;<br>
float xs = f1->GetXSpacing();<br> float ys = f1->GetYSpacing();<br> float zs = f1->GetZSpacing();// defaulted to 1.0 if not found strSpacing<br> (0x3004,0x000c)<br><br> const std::string strSpacing = GetEntryValue(0x3004,0x000c);<br>
const int MaxZ = 256;<br> float sp[MaxZ] = {1.0, 1.0} ;<br> if ( strSpacing != GDCM_UNFOUND )<br> {<br> if ( sscanf( strSpacing.c_str(), "%f \\ %f ", &sp[0],<br>
&sp[1]) >2 )<br> zs = sp[1]-sp[0];<br> }<br><br> float xo = f1->GetXOrigin();<br> float yo = f1->GetYOrigin();<br> float zo = f1->GetZOrigin();<br><br> std::cout << "GetXSpacing()" << xs << std::endl;<br>
std::cout << "GetYSpacing()" << ys << std::endl;<br> std::cout << "GetZSpacing()" << zs << std::endl;<br><br> std::cout << "GetXOrigin()" << xo << std::endl;<br>
std::cout << "GetYOrigin()" << yo << std::endl;<br> std::cout << "GetZOrigin()" << zo << std::endl;<br><br> return EXIT_SUCCESS;<br>
}<br> </div>