[elastix] Output image format

M.Staring at lumc.nl M.Staring at lumc.nl
Thu Mar 18 11:38:01 CET 2010


Hi  Vratislav,

> 
> Thank you a lot,
> 
> i found this also now on elastix webpage. But now i have a 
> different problem, i have two bmp files (gray-level 0 - 255), 
> and -fMask (mask.bmp 0-1). I save result image into bmp file, 
> but there is some artifacts (white pixels). Result image in 
> mhd format have intensity range (-38 to 283). How is 
> possible, that result image have different intensity range 
> than input image?

That is because of the overshoot of the 3-order B-spline interpolation used to generate the result image I_M(T(x)). Because the intensity of the moving image is evaluated at non-voxel position, interpolation is required.

> 
> As parameter file i use default0: Parameters_Translation.txt
> 
> For saving into bmp file:
> (ResultImagePixelType "unsigned char")
> (ResultImageFormat "bmp")
> 
> Here is used and result files http://elastix.vratik.cz/

The white artifacts are there for another reason. You have pixel values in the range -38, 283. However, you cast your output to unsigned char, which has a range [0,255]. Therefore, you will have clipping of your data. It is better to store the output as short image
(ResultImagePixelType "short")

If you really want to finally get a bmp or png image, you first need to rescale or window the short image to the range 0, 255 and only then convert it to unsigned char. You cannot do that in elastix.

Regards,

Marius

> 
> Thanks,
> Vratislav
> 
> 
> Dne 18.3.2010 10:24, M.Staring at lumc.nl napsal(a):
> > Hi  Vratislav
> >
> > It is possible to change the output file format. Just add
> >
> > 	(ResultImageFormat "png")
> >
> > to your parameter file. The default value for this 
> parameter is indeed mhd.
> >
> > Note that png is not a very good file format for medical 
> data, because it does not store image spacing, etc.
> >
> > Regards,
> >
> > Marius
> >
> >    
> >> -----Original Message-----
> >> From: elastix-bounces at bigr.nl
> >> [mailto:elastix-bounces at bigr.nl] On Behalf Of Vratislav Harabiš
> >> Sent: donderdag 18 maart 2010 10:14
> >> To: elastix at bigr.nl
> >> Subject: [elastix] Output image format
> >>
> >> Hi,
> >>
> >> it is possible to define format of the output image? I 
> have two input 
> >> images (fixed and moving) in png, but result of 
> registration is saved 
> >> only as metaimage (mhd, raw). I would like have result 
> image in png 
> >> too.
> >>
> >> Thank you
> >>
> >> Have a nice day
> >>
> >> Vratislav Harabis
> >> _______________________________________________
> >> elastix mailing list
> >> elastix at bigr.nl
> >> http://lists.bigr.nl/mailman/listinfo/elastix
> >>
> >>      
> 
> 



More information about the Elastix mailing list