[Insight-users] I still have a problem stacking many 2D Dicom slices to produce a big Dicom Slice (3D volume) and visualize it!

charfeddine amir charfeddine_amir at yahoo.fr
Sun Jan 29 04:50:07 EST 2006


Hi all,
 i've writed a code similar to the one in section 7.12.3 of the guide to read a serie of 131 Dicom file from a directory (each file contain a slice), then i save it into a volume file named "volume.vtk" (i've tried "volume.dcm" too). the reading and saving process was ok since i get well  the file volume.vtk, but when i tried to visualize it with VolView for example i get error:
 ERROR : In C:\kitware\VolView\VolView20\VTK\Graphics\vtkPlaneSource.cxx
 vtkPlaneSource (0x05D490A0): Bad Plane coordinate system.
 
 and the program crash.
 when i tried to open it with other example i find in InsightApplications i get only the first slice and not a volume...
 this is my code :
 
 
 
       
 char* chooserName = fl_dir_chooser("select a dicom directory", 0, 0);    // Store the filename   strcpy( m_InputImageDirectoryname, chooserName );   reader = ReaderType::New();   dicomIO = ImageIOType::New();   dicomIO->SetMaxSizeLoadEntry(0xffff);   nameGenerator = NamesGeneratorType::New();   reader->SetImageIO( dicomIO );   nameGenerator->SetUseSeriesDetails( true );   nameGenerator->SetDirectory( m_InputImageDirectoryname );      seriesUID = nameGenerator->GetSeriesUIDs();          seriesIdentifier = seriesUID.begin()->c_str();           fileNames = nameGenerator->GetFileNames( seriesIdentifier );     FileNamesBegin = fileNames.begin();     FileNamesItr = fileNames.end();     FileNamesEnd = fileNames.end();        rescaler = RescaleFilterType::New();   rescaler->SetOutputMinimum(   0 );   rescaler->SetOutputMaximum( 255 );   reader->SetFileName( FileNamesItr->c_str() );    rescaler->SetInput( reader->GetOutput() );   reader->Update();   m_InputImage = reader->GetOutput();  
 m_InputImage->SetRequestedRegionToLargestPossibleRegion();
   
seriesreader = SeriesReaderType::New();  // A GDCMImageIO object is created and connected to the reader. This object is // the one that is aware of the internal intricacies of the DICOM format.     seriesreader->SetImageIO( dicomIO );    seriesreader->SetFileNames( fileNames );      try       {       seriesreader->Update();       }     catch (itk::ExceptionObject &ex)       {       std::cout << ex << std::endl;              }  // At this point, we have a volumetric image in memory that we can access by // invoking the \code{GetOutput()} method of the reader.        writer = Writer2Type::New();        writer->SetFileName("Volume.vtk");    writer->SetInput( reader->GetOutput() );      try       { // Software Guide : BeginCodeSnippet           writer->Update(); // Software Guide : EndCodeSnippet           }     catch (itk::ExceptionObject &ex)       {       std::cout << ex << std::endl;       }

 Hi Pablo,
 
 it hope u send me the small utility you wrote, 
 any comment is welcome.
 Amir,
 

charfeddine amir <charfeddine_amir at yahoo.fr> a écrit : Hi Mathieu
 
 thx for your reply. i 've read the section 7.12 (about reading/writing DICOM from the ITK Software Guide) again, and espacially 7.12.3 (Reading a 2D DICOM Series and Writing a Volume ). i think that's what i'm searching.
 but still have a question : what are Volume format supported i can specify? and how to visualize a volume?
 Hi Pablo,
 
 thx for your message,
 it will be very helpful to me if u send me the small utility you wrote, if ever i crash somewhere (espacially i didn't know how to manipulate and visualize the result ( the volume )).
 thx very much for your kindness
 A+
 TimCha
 
Mathieu Malaterre <mathieu.malaterre at kitware.com> a écrit : Pablo,

How different is it from  
Insight/Examples/IO/DicomSeriesReadImageWrite2.cxx ? Maybe we could 
update the example, if it is lacking some features.

TimCha,

I would also recommend reading the section (7.12) about reading/writing 
DICOM from the ITK Software Guide.

HTH
Mathieu

Pablo D. Burstein wrote:
> Yes, it is possible to do that. As a matter of fact I wrote and use a 
> small utility application that does just that. I can send it to you if 
> you wish.
> 
> Cheers,
> Pablo.
> 
> charfeddine amir wrote:
> 
>> Hi all
>> I'm fronting a problem and hope your urgent help
>> is it possible after reading a number of 2D Dicom slice, to stack them 
>> into a 3D volume, and visualize the volume!
>> any comment is welcome,
>> thx a lot ,
>> TimCha
>>
>> ------------------------------------------------------------------------
>> Nouveau  : téléphonez moins cher avec Yahoo! Messenger ! Découvez les 
>> tarifs exceptionnels pour appeler la France et l'international. 
>> Téléchargez 
>>  
>> la version beta.
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Insight-users mailing list
>> Insight-users at itk.org
>> http://www.itk.org/mailman/listinfo/insight-users
>>  
>>
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 



   

---------------------------------
 Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international. Téléchargez la version beta._______________________________________________
Insight-users mailing list
Insight-users at itk.org
http://www.itk.org/mailman/listinfo/insight-users



		
---------------------------------
 Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.Téléchargez la version beta.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20060129/2ea80000/attachment.htm


More information about the Insight-users mailing list