[Insight-users] Confidence Connected Seed Coordinates

Bill Lorensen bill.lorensen at gmail.com
Tue Apr 15 13:23:16 EDT 2008


Can you print your image please?

inage->Print(std::cout);

On Tue, Apr 15, 2008 at 10:06 AM, Cameron Burnett
<w_e_b_m_a_s_t_e_r_6_9 at hotmail.com> wrote:
>
> First of all, thanks to everyone for your help.
>
> I tried to implement the TransformPhysicalPointToIndex function, but the
> indices are totally crazy (as you can see below in the code comments). I've
> put in comments for the output of test message boxes. You can see that the
> point is set up correctly, however the index is insane. The X and Z parts
> always remain at 0, however the Y part is absolutely massive in this
> case.... and often in other parts it just decides to go to -0. I tried
> rounding the pointtype input to int, but that just outputted 0, -0, 0.
>
> The line InternalImageType::ConstPointer image = reader->GetOutput()   is
> called after the reader->Update() . The image type at the moment is a 3d
> float. Only the code relevant to the problem has been included also.
>
> I've spent all day trying to figure this out, but it really doesn't make any
> sense to me. I put in a bool isInside to check the transform, but its
> obviously not inside the object when you have numbers like 5e^60.
>
> What is it that I'm doing wrong?? Its exactly the same as in the textbook
> example. Here is the relevant code.....
>
>
>   //InternalImageType is <float,3>
>
>   InternalImageType::PointType  point;
>   point[0] = seedX;      //seedX,Y,Z are float .... but i also tried casting
> to int
>   point[1] = seedY;
>   point[2] = seedZ;
>
>     //output = 95, 147, 7.5 (first 2 i have rounded to the nearest number)
>     CString s;
>     s.Format("%f %f %f",point[0],point[1],point[2]);
>     AfxMessageBox(s);
>
>   InternalImageType::IndexType  index;
>   InternalImageType::ConstPointer image = reader->GetOutput();
> //reader->Update() already called
>   image->TransformPhysicalPointToIndex( point, index );
>
>     //output = 0.0, -285748e^(more than 60 i think), 0.0
>     CString ss;
>     ss.Format("%f %f %f",index[0],index[1],index[2]);
>     AfxMessageBox(ss);
>
>
>
>
> Thanks.
> Cameron.
>
>
> ________________________________
> > Date: Mon, 14 Apr 2008 16:23:31 -0400
> > From: luis.ibanez at kitware.com
>
> > To: w_e_b_m_a_s_t_e_r_6_9 at hotmail.com
> > CC: bill.lorensen at gmail.com; insight-users at itk.org
>
>
> > Subject: Re: [Insight-users] Confidence Connected Seed Coordinates
> >
> >
> > Hi Cameron,
> >
> >
> > If you want to find the pixel value of an ITK image at a given physical
> > coordinate you may want to consider the two following options:
> >
> >
> > A) ImageType::PointType point = GetPointSomehow();
> > ImageType::IndexType index;
> > ImageType::PixelType pixelValue;
> >
> > ImageType::ConstPointer image = seriesReader->GetOutput();
> >
> > image->TransformPhysicalPointToIndex( point, index );
> >
> > if( image->GetBufferedRegion().IsInside(index) )
> > {
> > pixelValue = image->GetPixel( index );
> > }
> >
> > or
> >
> >
> > B) use the itk::NearestNeighborInterpolateImageFunction
> > as Interpolator type,
> >
> >
> > ImageType::ConstPointer image = seriesReader->GetOutput();
> >
> > interpolator->SetImage( image );
> >
> > pixelValue = interpolator->Evaluate( point );
> >
> >
> > From your email, it seem that you are more interested on the
> > index location than the actual pixel value. In that case, you
> > probably only need the first half of option (A).
> >
> >
> > Regards,
> >
> >
> > Luis
> >
> >
> > ------------------------
> > Cameron Burnett wrote:
> > > Oh ok. So there is no way to perhaps extract a pixel at a certain
> > > physical coordinate, from the ImageSeriesReader object ?? I had a look
> > > at the doxygen documentation for itk::ImageSeriesReader but there wasn't
> > > any method like that.
> > >
> > > The problem is that I'm doing this with 3D interaction. At the moment I
> > > don't have any 2D viewports at all. In order to find a seed point, the
> > > only logical thing I could think of was a vtkPointWidget. If that
> > > doesn't end up working then I'm not sure if it would be possible to do
> > > 3D region growing at all. Unless I can guess the seed point.
> > >
> > > Any ideas??
> > >
> > > Thanks.
> > >
> > >
> > >
> > > ------------------------------------------------------------------------
> > > > Date: Mon, 14 Apr 2008 10:16:44 -0400
> > > > From: bill.lorensen at gmail.com
> > > > To: w_e_b_m_a_s_t_e_r_6_9 at hotmail.com
> > > > Subject: Re: [Insight-users] Confidence Connected Seed Coordinates
> > > > CC: insight-users at itk.org
> > > >
> > > > Cameron,
> > > >
> > > > The Seed coordinates are in pixels, not physical coordinates. IN
> > > > addition, VTK flips the image, so you will need to flip your Y pixel
> > > > coordinate.
> > > >
> > > > We should probably add a method to the filters with Seeds to accept
> > > > physical coordinates. Please add a feature request in the ITK bug
> > > > tracker.
> > > >
> > > > This page explains how to submit a bug:
> > > > http://www.itk.org/Wiki/ITK_Procedure_for_Contributing_Bug_Fixes
> > > >
> > > > Thanks,
> > > >
> > > > Bill
> > > >
> > > >
> > > > On Mon, Apr 14, 2008 at 9:56 AM, Cameron Burnett
> > > > <w_e_b_m_a_s_t_e_r_6_9 at hotmail.com> wrote:
> > > > >
> > > > > Hi,
> > > > >
> > > > > I'm just wondering about the coordinate system of the confidence
> > > connected
> > > > > algorithm. I'm using a vtkPointWidget to select a seed point, and
> > > according
> > > > > to the point widget, my XY coordinates range from about -45,413
> > > (top-left)
> > > > > to 413,-45 (bottom-right).... and also a z coordinate which I've
> > > got as 7.5
> > > > > (middle slice).
> > > > >
> > > > > Now, when I plug that into the confidence connected SetSeed()
> method, I
> > > > > don't think the two coordinate systems are matching up because my
> > > results
> > > > > are a bit strange.
> > > > >
> > > > >
> > > > > The following picture is an image of two legs, and you can see the
> > > > > vtkPointWidget being positioned in the center of the femur.
> > > > >
> > > > > http://img382.imageshack.us/img382/2118/dicomimgaw7.jpg
> > > > >
> > > > > This is the result of a multiplier of 0.1, followed by a multiplier
> > > of 2.
> > > > >
> > > > > http://img397.imageshack.us/img397/9743/outputvtk01multiplierwd7.jpg
> > > > > http://img383.imageshack.us/img383/6727/outputvtk2multiplierfs6.jpg
> > > > >
> > > > > (Note: I think these may be a bit pixely due to the compression on
> > > > > imageshack, but the actual ones are just 2 solid colours)
> > > > >
> > > > >
> > > > > What I conclude from that is that the blue area is in fact the area
> > > that has
> > > > > been seeded, not the red area. Therefore that is why I believe that
> > > I have
> > > > > some sort of problem with the coordinates not matching. What do I
> > > have to do
> > > > > to make sure the point widget and the SetSeed() method both match
> up??
> > > > >
> > > > > And I also don't know why there are 2 colours in the vtk file, when
> one
> > > > > should obviously be transparent. Is that one easy to answer?
> > > > >
> > > > >
> > > > > Thanks for any help,
> > > > > Cameron.
> > > > >
> > > > >
> > > > >
> > > > > ________________________________
> > > > > Grab it. You dream job is up for grabs.
> > > > > _______________________________________________
> > > > > Insight-users mailing list
> > > > > Insight-users at itk.org
> > > > > http://www.itk.org/mailman/listinfo/insight-users
> > > > >
> > > > >
> > >
> > > ------------------------------------------------------------------------
> > > at CarPoint.com.au It's simple! Sell your car for just $30
> > >
> <http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fsecure%2Dau%2Eimrworldwide%2Ecom%2Fcgi%2Dbin%2Fa%2Fci%5F450304%2Fet%5F2%2Fcg%5F801459%2Fpi%5F1004813%2Fai%5F859641&_t=762955845&_r=tig_OCT07&_m=EXT>
> > >
> > >
> > > ------------------------------------------------------------------------
> > >
> > > _______________________________________________
> > > Insight-users mailing list
> > > Insight-users at itk.org
> > > http://www.itk.org/mailman/listinfo/insight-users
>
> ________________________________
> Grab it. You dream job is up for grabs.
> _______________________________________________
>  Insight-users mailing list
>  Insight-users at itk.org
>  http://www.itk.org/mailman/listinfo/insight-users
>
>


More information about the Insight-users mailing list