[Insight-users] 3D Segmentation Mask
Cameron Burnett
w_e_b_m_a_s_t_e_r_6_9 at hotmail.com
Mon May 5 10:24:10 EDT 2008
Thanks for that info Luis.
I implemented the box widget approach today and it seems to mask quite well, because the time it takes to run is drastically reduced. However I'm not actually getting anything to display on the screen.
I'm using the ImageReadRegionOfInterestWrite example, and the key section of code is as follows.
-------------------------------------------------------------------------
vtkPolyData *poly = vtkPolyData::New();
double bounds[6];
for(int i=0; i<6; i++){bounds[i] = NULL;}
boxWidget->GetPolyData(poly);
poly->GetBounds(bounds);
//then i set up the filter
InternalImageType::IndexType start;
start[0] = (int)bounds[0]; //xmin
start[1] = (int)bounds[2]; //ymin
start[2] = (int)bounds[4]; //zmin
InternalImageType::SizeType size;
size[0] = (int)(bounds[1]-bounds[0]); //xmax-xmin
size[1] = (int)(bounds[3]-bounds[2]); //etc...
size[2] = (int)(bounds[5]-bounds[4]);
//then i attach it all together, add it to the pipeline etc.
--------------------------------------------------------------------------------
I think my problem has something to do with the Start and Size indices. I'm not sure what i'm doing wrong though.
Thanks for any further help,
Cameron.
> Date: Wed, 30 Apr 2008 16:56:25 -0400
> From: luis.ibanez at kitware.com
> To: w_e_b_m_a_s_t_e_r_6_9 at hotmail.com
> CC: insight-users at itk.org
> Subject: Re: [Insight-users] 3D Segmentation Mask
>
> Hi Cameron,
>
> It seems that what you are looking for is a VTK interactive
> method for selecting a region of interest of your 3D image,
> that will be later passed to an ITK segmentation pipeline.
>
> Is that correct ?
>
> If so, one thing you could easily use is the
>
> vtkAffineWidget
> http://www.vtk.org/doc/nightly/html/classvtkAffineWidget.html
>
> or the
>
> vtkBoxWidget
> http://www.vtk.org/doc/nightly/html/classvtkBoxWidget.html
>
> or a combination of 3 ImagePlaneWidgets:
> http://www.vtk.org/doc/nightly/html/classvtkImagePlaneWidget.html
>
>
> That you will find the widgets under
>
>
> VTK/Widgets/
>
>
> You could interactively manipulate their handles until you have
> captured the region of interest and then (programatically)
> you could query the current state of the widget in order to
> deduce the coordinates of its corners.
>
> The coordinate of the region of interest could then be passed
> as a Region to the itkRegionOfInterestImageFilter.
>
>
>
>
> Regards,
>
>
> Luis
>
>
>
> ----------------------
> Cameron Burnett wrote:
> > Hi,
> >
> > Currently I'm trying to figure out how to create a mask for
> > segmentation. The way i'm thinking of doing it is using a
> > MaskImageFilter to mask my DICOM object with a vtkActor cube object that
> > I generated just from points. To do that I need to figure out 1 of 2
> > things (due to the fact that you can't plug an actor straight into the
> > mask filter). Either I replace that vtkActor with some sort of ITK box
> > primitive that can go straight into the filter, OR I somehow convert the
> > object into the correct itk image form.
> >
> > Does that make sense?? Generally I just want to segment only the stuff
> > inside a box that I can move around. That's the simple way of putting it.
> >
> > I was looking at this example in the Insight Applications
> > "vtkPolyDataToITKMesh.cxx" , but I'm not sure thats what I'm after. Also
> > I found a bit on the mailing list about
> > "TriangleMeshToBinaryImageFilter" but that has just left me even more
> > confused.
> >
> > Is there an easier way to create an interactive/movable/scaleable 3D
> > mask, other than a cube represented by a vtkActor? What sort of stuff
> > should I be looking to use for this approach (or a similar one) ??
> >
> > Thanks in advance,
> > Cameron.
> >
> >
> >
> >
> >
> > ------------------------------------------------------------------------
> > Click here Search for local singles online @ Lavalife.
> > <http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Flavalife9%2Eninemsn%2Ecom%2Eau%2Fclickthru%2Fclickthru%2Eact%3Fid%3Dninemsn%26context%3Dan99%26locale%3Den%5FAU%26a%3D30290&_t=764581033&_r=email_taglines_Search_OCT07&_m=EXT>
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Insight-users mailing list
> > Insight-users at itk.org
> > http://www.itk.org/mailman/listinfo/insight-users
_________________________________________________________________
Are you paid what you're worth? Find out: SEEK Salary Centre
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fninemsn%2Eseek%2Ecom%2Eau%2Fcareer%2Dresources%2Fsalary%2Dcentre%2F%3Ftracking%3Dsk%3Ahet%3Asc%3Anine%3A0%3Ahot%3Atext&_t=764565661&_r=OCT07_endtext_salary&_m=EXT
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20080506/e0b8be6e/attachment.htm>
More information about the Insight-users
mailing list