[vtkusers] Problem with image displayed Pixels

Mathieu Coursolle mcoursolle at rogue-research.com
Wed May 13 08:42:32 EDT 2009


Hi VTK/ITK users,

 From what I understand, the origin is, by definition (VTK and ITK),  
the center of the first voxel.
Therefore, the bounds of your image is computed as (Size - 1) * Spacing.
This is well described in the ITK Software Guide. in the  
DataRepresentation chapter.

If your think of your image as a sampled grid, then you would compute  
your bounds as the first and the last
sample in each direction. In that context, it makes sense to have each  
sample the center of your pixels.

I think that you can use vtkImageViewer(2) if you want to view your  
image as a regular image (full pixels on edges).
Maybe someone could confirm that ?

Thanks,

Mathieu




On 13-May-09, at 7:22 AM, Shady Shidfar wrote:

> Hi everyone, I'm having a problem with converting ITK image into VTK  
> and because I'm not sure if the problem is related to ITK or VTK I'm  
> sending this mail to both forums hoping someone can help.
> I'm converting my ITK image to a VTK object using  
> itkImageToVTKImageFilter. The  image has the origin of 0,0 and  
> spacing 1,1. The problem is that it seems that the edge pixels of  
> the image I view in VTK have spacing of 0.5,1 or 1,0.5 , So they  
> look like a half pixel. This to me looks like a bug. I'm not sure if  
> the problem is with pixel dimentions in VTK or ITK or it has to do  
> with the itkImageToVTKImageFilter. I'm attaching the image file and  
> a picture of what I view in VTK and the same image viewed in ImageJ.  
> It seems like the image has been slightly cropped. It can be seen  
> that data is obviously being lost at the edges. Can someone please  
> help me with this? Any idea what the problem is and how can I fix it.
>
> Thanks in advance
> Shaadi
>
> < 
> brainCrop 
> .tif 
> > 
> < 
> ImageJDisplay 
> .JPG><VTKDisplay.JPG>_______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers







-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090513/4b7cb243/attachment.htm>


More information about the vtkusers mailing list