<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content=text/html;charset=iso-8859-7>
<META content="MSHTML 6.00.6000.16640" name=GENERATOR></HEAD>
<BODY id=MailContainerBody
style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px"
bgColor=#ffffff leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV><FONT face=Arial size=2>I use the example <FONT face=Courier
size=2>Examples/IO/DicomSeriesReadImageWrite2.cxx
<P><FONT face=Arial>to read a DICOM series and write the volume as a .mha. When
i visualize the volume using vtk i get the following </FONT></P>
<P><FONT face=Arial><A
title="http://img122.imageshack.us/img122/718/vtkvolumeod4.jpg CTRL + Click to follow link"
href="http://img122.imageshack.us/img122/718/vtkvolumeod4.jpg">http://img122.imageshack.us/img122/718/vtkvolumeod4.jpg</A></FONT></P>
<P><FONT face=Arial>When i visualize the volume brainweb1e1a10f20.mha that i get
from ITK data the result is this</FONT></P>
<P><FONT face=Arial><A
title="http://img59.imageshack.us/img59/8670/vtkvolumenormalco1.jpg CTRL + Click to follow link"
href="http://img59.imageshack.us/img59/8670/vtkvolumenormalco1.jpg">http://img59.imageshack.us/img59/8670/vtkvolumenormalco1.jpg</A></FONT></P>
<P><FONT face=Arial>As you can see the first volume has not opacity at all. I
mean i cannot see the brain inside the skull. Moreover the volume looks more
like a cube to me cause of the images that compose it. The main problem is that
i want to create a registration application and the registration will take hours
if the volumes i create look like the first one, not to say that it will give me
errors at the end. <FONT face=Arial>What am i doing wrong? Or is it chance a
fault of the DICOM dataset i am using? </FONT></P></FONT>
<P><FONT face=Arial>Here is the code of </FONT><FONT
face=Courier>DicomSeriesReadImageWrite2.cxx</FONT></P>
<P><FONT face=Arial>{</FONT></P>
<P><FONT face=Arial>typedef signed short
PixelType;<BR> const unsigned int Dimension =
3;</FONT></P>
<P><FONT face=Arial> typedef itk::OrientedImage< PixelType, Dimension
> ImageType;</FONT></P>
<P><FONT face=Arial> typedef itk::ImageSeriesReader< ImageType >
ReaderType;<BR> ReaderType::Pointer reader = ReaderType::New();</FONT></P>
<P><FONT face=Arial> typedef
itk::GDCMImageIO
ImageIOType;<BR> ImageIOType::Pointer dicomIO =
ImageIOType::New();</FONT></P>
<P><FONT face=Arial> reader->SetImageIO( dicomIO );</FONT></P>
<P><FONT face=Arial> typedef itk::GDCMSeriesFileNames
NamesGeneratorType;<BR> NamesGeneratorType::Pointer nameGenerator =
NamesGeneratorType::New();</FONT></P>
<P><FONT face=Arial> nameGenerator->SetUseSeriesDetails( true
);<BR> nameGenerator->AddSeriesRestriction("0008|0021" );</FONT></P>
<P><FONT
face=Arial> nameGenerator->SetDirectory(directoryPath);<BR> <BR> std::cout
<< std::endl << "The directory: " <<
std::endl;<BR> std::cout << std::endl << directoryPath <<
std::endl << std::endl;<BR> std::cout << "Contains the
following DICOM Series: ";<BR> std::cout << std::endl <<
std::endl;</FONT></P>
<P><FONT face=Arial> typedef std::vector< std::string
> SeriesIdContainer;</FONT></P>
<P><FONT face=Arial> const SeriesIdContainer & seriesUID =
nameGenerator->GetSeriesUIDs();</FONT></P>
<P><FONT face=Arial> SeriesIdContainer::const_iterator seriesItr =
seriesUID.begin();<BR> SeriesIdContainer::const_iterator seriesEnd =
seriesUID.end();<BR> while( seriesItr != seriesEnd )
{<BR> std::cout << seriesItr->c_str() <<
std::endl;<BR> seriesItr++;<BR> }</FONT></P>
<P><FONT face=Arial> std::string
seriesIdentifier;<BR> seriesIdentifier =
seriesUID.begin()->c_str();<BR> <BR> std::cout << std::endl
<< std::endl;<BR> std::cout << "Now reading series: " <<
std::endl << std::endl;<BR> std::cout << seriesIdentifier
<< std::endl;<BR> std::cout << std::endl <<
std::endl;</FONT></P>
<P><FONT face=Arial> typedef std::vector< std::string >
FileNamesContainer;<BR> FileNamesContainer fileNames;</FONT></P>
<P><FONT face=Arial> fileNames = nameGenerator->GetFileNames(
seriesIdentifier );</FONT></P>
<P><FONT face=Arial> reader->SetFileNames( fileNames
); <BR> reader->Update();<BR> <BR> typedef
itk::ImageFileWriter< ImageType > WriterType;<BR>
WriterType::Pointer writer = WriterType::New();<BR>
<BR> writer->SetFileName("output.mha");</FONT></P>
<P><FONT face=Arial>
writer->SetInput(reader->GetOutput());</FONT></P>
<P><FONT face=Arial> std::cout << "Writing the
image as " << std::endl << std::endl;<BR>
std::cout << "output.mha" << std::endl <<
std::endl;</FONT></P>
<P><FONT face=Arial> writer->Update();</FONT></P>
<P><FONT face=Arial>}</FONT></P>
<P><FONT face=Arial>Thanks in advance.</FONT></P>
<P><FONT face=Arial></FONT></FONT><FONT face="Times New Roman"
size=2> </P></FONT></FONT></DIV></BODY></HTML>