<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi VTK/ITK users,</div><div><br></div><div>From what I understand, the origin is, by definition (VTK and ITK), the center of the first voxel.</div><div>Therefore, the bounds of your image is computed as (Size - 1) * Spacing.&nbsp;</div><div>This is well described in the ITK Software Guide. in the DataRepresentation chapter.&nbsp;</div><div><br></div><div>If your think of your image as a sampled grid, then you would compute your bounds as the first and the last</div><div>sample in each direction. In that context, it makes sense to have each sample the center of your pixels.</div><div><br></div><div>I think that you can use vtkImageViewer(2) if you want to view your image as a regular image (full pixels on edges).</div><div>Maybe someone could confirm that ?</div><div><br></div><div>Thanks,</div><div><br></div><div>Mathieu</div><div><br></div><div><div><br></div></div><div><br></div><br><div><div>On 13-May-09, at 7:22 AM, Shady Shidfar wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: normal; "><span style="font-size: 12pt; color: black; font-family: 'Times New Roman', serif; ">Hi everyone,&nbsp;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.<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: normal; "><span style="font-size: 12pt; color: black; font-family: 'Times New Roman', serif; ">I'm converting my ITK image to a VTK object using itkImageToVTKImageFilter. The<span class="Apple-converted-space">&nbsp;</span><span>&nbsp;</span>image has the origin of 0,0 and spacing 1,1. The problem is that&nbsp;it seems that&nbsp;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&nbsp;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.<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: normal; "><span style="font-size: 12pt; color: black; font-family: 'Times New Roman', serif; ">&nbsp;<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: normal; "><span style="font-size: 12pt; color: black; font-family: 'Times New Roman', serif; ">Thanks in advance<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; line-height: normal; "><span style="font-size: 12pt; color: black; font-family: 'Times New Roman', serif; ">Shaadi</span>&nbsp;</div></div></div></div><br><span>&lt;brainCrop.tif></span><span>&lt;ImageJDisplay.JPG></span><span>&lt;VTKDisplay.JPG></span>_______________________________________________<br>Powered by<span class="Apple-converted-space">&nbsp;</span><a href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<span class="Apple-converted-space">&nbsp;</span><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Please keep messages on-topic and check the VTK FAQ at:<span class="Apple-converted-space">&nbsp;</span><a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><br></div></span></blockquote></div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"> </div><br></body></html>