[vtkusers] Setting VOI in a circular manner

Hayden Smith s_hayden_28 at yahoo.com
Mon Apr 22 20:39:05 EDT 2013


Hi,
    Thank you very much for the reply. I have tried to two circular ROIs and two vtkImageStencil filters as follows:
 
/*******************************************************/vtkImageReader reader
reader SetDataByteOrderToBigEndian
reader SetDataExtent 0 255 0 255 1 30
reader SetDataScalarTypeToChar
reader SetDataOrigin 0.0 0.0 0.0
reader SetDataSpacing 0.8 0.8 1.5
reader SetFilePrefix "images/"
reader SetFilePattern "%s%d.img"
reader SetNumberOfScalarComponents 1
reader Update
vtkImageCast cast
cast SetInputConnection [v16 GetOutputPort]
cast SetOutputScalarTypeToUnsignedShort
cast Update
 
vtkROIStencilSource roiStencil2
roiStencil2 SetShapeToCylinderZ
roiStencil2 SetBounds 90 130 90 130 0 500
roiStencil2 SetInformationInput [cast GetOutput]
 
vtkROIStencilSource roiStencil1
roiStencil1 SetShapeToCylinderZ
roiStencil1 SetBounds 70 135 70 135 0 500
roiStencil1 SetInformationInput [cast GetOutput]
 
vtkImageStencil stencil1
stencil1 SetInput [cast GetOutput]
stencil1 SetStencil [roiStencil1 GetOutput]
 
vtkImageStencil stencil2
stencil2 ReverseStencilOn
stencil2 SetInput [cast GetOutput]
stencil2 SetStencil [roiStencil2 GetOutput]
 
/**********************************************************/
 
But it is not working. As after separating the first part, I need to work with that part, not the original image. But if I try to input one vtkROIStencilSource as input to second image stencil, it does not work. Do i need to convert to image the first stencil before using second stencil?
 
Thanks,
Hayden.

From: David Gobbi <david.gobbi at gmail.com>
To: Hayden Smith <s_hayden_28 at yahoo.com> 
Cc: "vtkusers at vtk.org" <vtkusers at vtk.org> 
Sent: Sunday, April 21, 2013 7:28 PM
Subject: Re: [vtkusers] Setting VOI in a circular manner


You can probably do this with two circular ROIs and two
vtkImageStencil filters, one after the other.  Set ReverseStencilOn()
for the second fllter.

On Sun, Apr 21, 2013 at 6:05 PM, Hayden Smith <s_hayden_28 at yahoo.com> wrote:
> Hello,
>      Thank you very much. I have been able to cut a circular portion from
> the image and construct a polydata using your suggestion. Now suppose I have
> set two circular ROIs one inside another in a cylindrical manner and I only
> want to visualize the cylindrical portion, could any one suggest me how that
> can be done.
>    Or is there any method available in VTK about cutting out a cylindrical
> portion from the center of an object.
>
> Thank in advance.
>
> Regards,
> Hayden.
> From: David Gobbi <david.gobbi at gmail.com>
> To: Hayden Smith <s_hayden_28 at yahoo.com>
> Cc: "vtkusers at vtk.org" <vtkusers at vtk.org>
> Sent: Sunday, April 21, 2013 10:13 AM
> Subject: Re: [vtkusers] Setting VOI in a circular manner
>
> Hi Hayden,
>
> The vtkROIStencilSource can generate a circular ROI for an image that
> some of the other image filters can use, e.g. vtkImageStencil can
> black out all pixels that are outside of the ROI.
>
> - David
>
> On Sun, Apr 21, 2013 at 8:58 AM, Hayden Smith <s_hayden_28 at yahoo.com> wrote:
>> Dear VTK users,
>>        I would like to know while using vtkImageReader, is it  possible to
>> set VOI in a circular manner from the center of image? Current
>> implementation shows setting of VOI in a rectangle.
>>
>> Thanks and regards,
>> Hayden.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130422/2e94378a/attachment.htm>


More information about the vtkusers mailing list