[Insight-users] Visualizing or Saving SpatialObjects Volume

Louis MAYAUD louis.mayaud at ge.com
Tue Apr 1 05:39:58 EDT 2008


Hi everybody,

I doing internship at GE Healthcare and I would like to try RGC on
vessel tree segmentation. By now, I 'played' with ITK in order to see
how far I can go with (mean I not very familiar with it)

I realized a vessel tree segmentation and used the Vesseltube
SpatialObject to roughly represent it.
In order to visualized that result, I tried to export it as a *.meta
file through SpatialObjectWriter (I think I don't have any other way to
export that structure)
Then I tried to convert that *.meta file into an other file format with
the following code:
	
=====================================
// Image reader
typedef itk::Image< unsigned short , 3 > ImageType ;
typedef itk::ImageFileReader< ImageType > ImageReaderType ;
ImageReaderType::Pointer imageReader = ImageReaderType::New() ;
imageReader->SetFileName("ellipse.meta") ;

// META type def
typedef itk::MetaImageIO MetaIOType ;
MetaIOType::Pointer metaIO = MetaIOType::New() ;
metaIO->SetFileTypeToASCII() ;
imageReader->SetImageIO( metaIO ) ;

// Image Writer
typedef itk::ImageFileWriter< ImageType > ImageFileWriterType ;
ImageFileWriterType::Pointer imageFileWriter =
ImageFileWriterType::New() ;
imageFileWriter->SetInput( imageReader->GetOutput() ) ;
imageFileWriter->SetFileName( "ellipse.vtk" ) ;

// VTK type def
typedef itk::VTKImageIO ImageIOType;
ImageIOType::Pointer vtkIO = ImageIOType::New();
vtkIO->SetFileTypeToASCII();
imageFileWriter->SetImageIO( vtkIO );

try 
{ 
imageFileWriter->Update();
} 
catch( itk::ExceptionObject & err ) 
{ 
std::cerr << "ExceptionObject caught !" << std::endl; 
std::cerr << err << std::endl; 
return EXIT_FAILURE;
} 

====================================
 
And I get the following errors : 

Skipping unrecognized field NObjects
Skipping unrecognized field Radius
DimSize required and not defined.
MetaObject: Read: MET_Read Failed
MetaImage: M_Read: Error parsing file
MetaImage: Read: Cannot parse file
ExceptionObject caught !

itk::ExceptionObject (0x6a5f00)
Location: "Unknown"
File: /export/home/mayaudlo/ITK/Code/IO/itkMetaImageIO.cxx
Line: 175
Description: File cannot be read


=====================================


>From that I guess SpatialObjectWriter only save the data structure (but
in that case why does it use MetaIO? ). And the question will finaly
be :

How can I visualize the data structure? 
Why the way I do it is not convenient?

Thank you for your help

Louis 
   
-- 
Louis Mayaud
GE Healthcare
Europe

T +33 1 3070 4253
C +33 6 5066 3491
E louis.mayaud at ge.com
www.gehealthcare.com

238, rue de la miniere
78 530 Buc, France


More information about the Insight-users mailing list