[vtkusers] coordinate of vtkImagereader

Ken Martin ken.martin at kitware.com
Fri Nov 30 08:35:29 EST 2001


Currently in VTK an image is of size  (numpixels -1)*pixelSpacing
where a pixel is considered a sample point. So the image does not
include any areas that are not bounded by the sample points. This
leads to your size issue. We will be changing this so that an image is
numPixels*spacing in the future. There was some discussion on the list
about this a few months ago.

Thanks
Ken

> -----Original Message-----
> From: vtkusers-admin at public.kitware.com
> [mailto:vtkusers-admin at public.kitware.com]On Behalf Of zhangzhijun
> Sent: Saturday, December 29, 2001 11:19 PM
> To: vtkusers at public.kitware.com
> Subject: [vtkusers] coordinate of vtkImagereader
>
>
> Dear all:
>    After I read a volume data using vtkImagereader then I use a
> vtkImageviewer to
> show it in a window. I see from the image content that my
> image beginning is
> displayed
> in the left top corner, but the data origin point
> (-511*0.653595/2,-511*0.653595/2, -54)
> seems in the lower left point. I don't know whether this is
> the conventiion
> in the vtkimagereader.
> Can anyone tell me the coordinate definition in the imagreader.
>
>  reader->SetDataExtent(0,511,0,511,1,28);
>   reader->SetDataSpacing(0.653595,0.653595,4.0);
>   reader->SetDataOrigin(-511*0.653595/2,-511*0.653595/2, -54);
> //
> reader->SetFilePrefix("c:/vtk/vtk32/vtksrc/vtkdata/fullHead/
> headsq");
>   reader->SetFilePrefix("D:/regdata/patient_001/ct/image_m/ct");
>   reader->SetDataScalarTypeToShort();
>
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers




More information about the vtkusers mailing list