[Insight-users] multidimensional EM with volumetric images in ITK

Audette, Michel Michel.Audette at medizin.uni-leipzig.de
Wed May 2 05:56:06 EDT 2007


Dear Luis, 

I'm running into a few problems in the implementation details of the solution that you proposed to me. It's likely that I'm missing some understanding of what you meant precisely, and I may have a typedef or two missing. 

What follows are my declarations in my header file...

 typedef float     PixelType;
 typedef itk::OrientedImage<PixelType, 3> myImage;
 myImage::Pointer imagefixed;
 myImage::IndexType pixelIndex;
 typedef itk::ImageFileReader<myImage>  ReaderType;
 ReaderType::Pointer reader;  
 typedef itk::MINC2ImageIO ImageIOType;
 ImageIOType::Pointer minc2ImageIO; 

 //vector image 
 typedef itk::ImageToVectorImageFilter<myImage> imageToVectorFilter; 
 MultiComponentImageType::ConstPointer vectorImage;

and what I see are the following error messages...

VoxelClass3D.h:705: error: typedef name may not be a nested-name-specifier
VoxelClass3D.h:705: error: expected ‘;’ before ‘<’ token
VoxelClass3D.h:706: error: ‘MultiComponentImageType’ has not been declared
VoxelClass3D.h:706: error: ‘ConstPointer’ does not name a type

I'm not sure how to specify itk::ImageToVectorImageFilter<> if not for <myImage>, and perhaps by MultiComponentImageType you designate something that I should typedef myself, or an ITK class (cannot find it anywhere...)? 

As for the EM itself, is it understood that the components are initialized, let's say for a 3-volume input, as follows... 
  ParametersType params( 2 );
  std::vector< ParametersType > initialParameters( numberOfClasses, 3 );

  for ( unsigned int i = 0 ; i < numberOfClasses ; i++ )
    {
     components.push_back( ComponentType::New() );
    (components[i])->SetSample( adaptor );
    (components[i])->SetParameters( initialParameters[i] );
    ...
}
? 
(i.e.: each component is initialized with a 3-vector of ParametersType, each of which is a 2-vector?)

Best regards, 

Michel

Michel Audette, Ph.D. 
Innovation Center Computer Assisted Surgery (ICCAS) 
Philipp-Rosenthal-Strasse 55
Leipzig, Germany
Phone: ++49 (0) 341 / 97 - 1 20 13
Fax: ++49 (0) 341 / 97 - 1 20 09


-----Original Message-----
From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
Sent: Mon 4/30/2007 5:51 PM
To: Audette, Michel
Cc: Insight Users
Subject: Re: [Insight-users] multidimensional EM with volumetric images in ITK
 

Hi Audette,

The version with the hard-coded number of components will run
faster than the version that only knows the number of components
at run time.

The reason is that, for the second version (number of components
at run time), you will need to use the itkVectorImage, and in
this class, the (vector) pixel values are constructed on the fly
every time that you access a pixel. Therefore, there is a price
to pay for the flexibility of allowing to choose the number of
components at run time.



    Regards,


       Luis


----------------------
Audette, Michel wrote:
> Hi Luis, 
> 
> Thanks for your kind reply. I can hard-code the number of inputs, but I would otherwise keep it general, and have the program respond to the number of inputs that I supply it at runtime. How does it affect this processing pipeline? Is there a significant advantage to the hard-coded option?
> 
> Best regards, 
> 
> Michel
> 
> 
> -----Original Message-----
> From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
> Sent: Mon 4/30/2007 3:32 PM
> To: Audette, Michel
> Cc: Insight Users
> Subject: Re: [Insight-users] multidimensional EM with volumetric images in ITK
>  
> 
> 
> Hi Audette,
> 
> 
> Thanks for the clarification.
> 
> 
> Regarding the construction of a multi-component image out of a
> series of   single-component images, one option is to use the:
> 
>       ImageToVectorImageFilter
> 
> http://www.itk.org/Insight/Doxygen/html/classitk_1_1ImageToVectorImageFilter.html
> 
> 
> You may do this by taking a single ImageFileReader
> and inside a for loop do the following:
> 
> 
>    for( i =0 to number of input volumes )
>      {
>      reader->SetFileName( of this volume )
>      reader->Update();
>      ImageType::ConstPointer image = reader->GetOutput();
>      image->DisconnectPipeline();
>      imageToVectorFilter->SetNthInput( i, image );
>      }
> 
>    imageToVectorFilter->Update();
> 
>    MultiComponentImageType::ConstPointer vectorImage =
>       imageToVectorFilter->GetOutput();
> 
> 
>    ... then connect this vectorImage to an ImageToListAdaptor...
> 
>    ... then use the EM framework....
> 
> 
> 
> An important question:
> 
> 
>    Do you know in advance (at compilation time) the number of
>    components of your image ?  or you only will know this number
>    at run-time ?
> 
> 
> 
> 
> 
>    Regards,
> 
> 
> 
>      Luis
> 
> 
> 
> ------------------------
> Audette, Michel wrote:
> 
>>Hi Luis, 
>>
>>first, VTK was a typo. I meant ITK. 
>>
>>Second, how is a series of volumetric images read into the FixedArray? Does one use a SetInput() for each of the image components? I cannot find a good example that uses truly multidimensional data, amongst the standard examples.
>>
>>Best regards, 
>>
>>Michel
>>
>>-----Original Message-----
>>From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
>>Sent: Mon 4/30/2007 3:00 PM
>>To: Audette, Michel
>>Cc: insight-users at itk.org
>>Subject: Re: [Insight-users] multidimensional EM with volumetric images in ITK
>> 
>>
>>Hi Audette,
>>
>>
>>Yes,
>>what you are planning to do is entirely feasible with ITK.
>>
>>
>>1) Why do you want to pass the image through  VTK ?
>>    it seems that most of it can be done directly in ITK
>>
>>
>>2) You may want to look at the papers regarding new
>>    readers for the MINC format in the Insight Journal:
>>      http://www.insight-journal.org/
>>http://insight-journal.org/dspace/handle/1926/191
>>
>>
>>3) If you read your images using a Vector type as pixel
>>    type, for example, FixedArray<double,6>, you can then
>>    connect this image to an ImageToListAdaptor, and then
>>    use the resulting ListSample class in the framework
>>    of any classifier, such as the EM methods.
>>
>>    When you take a image with multiple-components pixel
>>    type and adapt it as a ListSample, it generates a
>>    multi-variate sample.
>>
>>
>>
>>   Regards,
>>
>>
>>      Luis
>>
>>
>>-----------------------
>>Audette, Michel wrote:
>>
>>
>>>Dear Insight Users,
>>>
>>>I would like to read in several image (minc format) volumes, and use those to define a multidimensional VTK image. I would then like to run an Expectation Maximization method that attempts to find multidimensional Gaussians, using some kind of ImageToListAdaptor (vector itkImageToListAdaptor?). Each input would be read separately, but how does one go about casting those scalar image inputs as part of a vector-valued image, over which to run EM? Is such a thing feasible in ITK?
>>>
>>>Cheers,
>>>
>>>Michel
>>>
>>>Michel Audette, Ph.D. 
>>>Innovation Center Computer Assisted Surgery (ICCAS) 
>>>Philipp-Rosenthal-Strasse 55
>>>Leipzig, Germany
>>>Phone: ++49 (0) 341 / 97 - 1 20 13
>>>Fax: ++49 (0) 341 / 97 - 1 20 09
>>>
>>>
>>>
>>>_______________________________________________
>>>Insight-users mailing list
>>>Insight-users at itk.org
>>>http://www.itk.org/mailman/listinfo/insight-users
>>>
>>
>>
>>
> 
> 



More information about the Insight-users mailing list