<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2800.1498" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=092503515-11052005>Hi, Luis and ITK
users:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=092503515-11052005></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=092503515-11052005>I recently tried to
adopt the GDCM dicom code for loading dicom series images,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=092503515-11052005>and then
consequently saving images in dicom series. However, when I read
the</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=092503515-11052005>images, the spacing
in z-direction is incorrect, leading to a compressed image</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=092503515-11052005>in z-direction. Here
is the related code, could you help me to identify anything </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=092503515-11052005>wrong?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=092503515-11052005></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=092503515-11052005>class
CMDIDataITKIO
<BR>{<BR> public:<BR> CMDIDataITKIO();<BR> virtual
~CMDIDataITKIO();<BR> public:<BR> void
ReadGDCM_DicomImages(const char*,
SeriesReaderType::Pointer);<BR> void WriteGDCM_DicomImages(const
char*, ImageType::Pointer);<BR> private:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=092503515-11052005> //
initiate in the ctor, and raise clean flag in
dtor.<BR> GDCMImageIOType::Pointer
m_gdcmIO;<BR> GDCMSeriesNames::Pointer
m_gdcmNames;<BR> SeriesReaderType::Pointer
m_gdcmReader;<BR>}</SPAN></FONT></DIV>
<DIV> </DIV><FONT><SPAN class=092503515-11052005>
<DIV><BR><FONT face=Arial size=2>void CMDIDataITKIO::ReadGDCM_DicomImages(const
char* folderName, <BR> <SPAN
class=092503515-11052005>
</SPAN>SeriesReaderType::Pointer reader)<BR>{</FONT></DIV>
<DIV><FONT face=Arial size=2> if(!m_gdcmIO) m_gdcmIO =
GDCMImageIOType::New();<BR> if(!m_gdcmNames) m_gdcmNames =
GDCMSeriesNames::New();</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> // Get the DICOM filenames from the
directory<BR> m_gdcmNames->SetInputDirectory(folderName);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> reader->SetFileNames(
m_gdcmNames->GetInputFileNames() );<BR> reader->SetImageIO( m_gdcmIO
);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> try
{<BR> reader->Update();<BR> }<BR> catch
(itk::ExceptionObject &excp) {<BR> std::cerr << "Exception
thrown while writing the image" << std::endl;<BR> std::cerr
<< excp << std::endl;<BR> }<BR>}<BR></FONT></DIV>
<DIV><FONT><SPAN class=092503515-11052005><FONT face=Arial
size=2>Thanks,</FONT></SPAN></FONT></DIV>
<DIV><FONT><SPAN class=092503515-11052005><FONT face=Arial
size=2></FONT></SPAN></FONT> </DIV>
<DIV><FONT><SPAN class=092503515-11052005><FONT face=Arial
size=2>George</FONT></SPAN></FONT></DIV>
<DIV><FONT><SPAN class=092503515-11052005><FONT face=Arial
size=2></FONT></SPAN> </DIV></FONT></SPAN></FONT></BODY></HTML>