[Insight-users] Question regarding creating Analyze or Raw volumes?

Luis Ibanez luis.ibanez at kitware.com
Sun Jul 29 13:42:39 EDT 2007


Hi Tina,

You may want to use the MetaImage file format instead of
Analyze and RAW.

With MetaImage you can save pixel types as "float", or
"double".

You just need to use an extension ".mhd", and the
ImageFileWriter will create two files:

    1) Text header file with extension .mhd
    2) Binary Raw data file with extension .raw



Regards,


    Luis


-----------------------------------
Ehtiati, Tina (SCR US EXT) wrote:
> Hello,
>  
> I have a question regarding using Analyze or Raw image file formats.
>  
> In my program I read a test volume and compute the probability of 
> each voxel in the volume belonging to some
> class A.
>  
>  It is important for me to keep the spatial location of the computed 
> probability values. So I want to store the probability values computed 
> for every voxel, in a new volume with the same size and spacing 
> information as the original volume, so l can compare the probability map 
> with the original image.
>  
> Right now, I create an output volume in Analyze format ( with the same 
> header information as the input volume), and store the probability 
> values  in it. When I open the output volume it looks alright in terms 
> of corresponding to the original image. But I am not sure if I am 
> keeping the correct numerical values for the computed probabilities in 
> my output volume. I compute the probabilities as double, then cast them 
> in float, and then write them in the output volume using SetPixel( ).  I 
> get a warning when running the program. Can I store float values in the 
> Analyze image? Do I loose any precision storing my numerical data in 
> Analyze format?
>  
> I tried saving it as Raw image, using RawImageIO, and I get some errors 
> in compile time as following:
>  
> error C2955: 'RawImageIO' : use of class template requires template 
> argument list
>        
> error C2955: 'RawImageIO' : use of class template requires template 
> argument list
>  
> error C2514: 'itk::SmartPointer<class 
> itk::RawImageIO<TObjectType,`template-parameter258'> >' : class has no 
> constructors
> 
> error C2262: 'rawIO' : cannot be destroyed
> 
> error C2664: 'SetImageIO' : cannot convert parameter 1 from 'class 
> itk::SmartPointer<class itk::RawImageIO<TOb
> jectType,`template-parameter258'> >' to 'class itk::ImageIOBase *'  No 
> user-defined-conversion operator available that can perform this 
> conversion, or the operator cannot be called
> Error executing cl.exe.
>  
> I appreciate your feedback,
>  
> Tina
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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