<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'><div style="text-align: left;"><br></div>Hmm, yeah I was right. I set the origin to 0,0,0 and it worked. However, I have to select the seed point with respect to a flipped Y axis. I thought that I would have to flip the FINAL vtk file, but it looks like I need to flip the displayed DICOM object instead.<br><br>I'm also still unsure as to why the vtk file is showing the unsegmented space in red though. What's up with that?<br><br>Thanks for your help everyone. Its been great.<br><div></div><br><br><blockquote><hr id="EC_stopSpelling">From: w_e_b_m_a_s_t_e_r_6_9@hotmail.com<br>To: bill.lorensen@gmail.com<br>Date: Wed, 16 Apr 2008 20:19:17 +1000<br>CC: insight-users@itk.org<br>Subject: Re: [Insight-users] Confidence Connected Seed Coordinates<br><br>

<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML">
<style>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Tahoma;}
</style>

<div style="text-align: left;">This is what I managed to find. 512x512 slices, and 11 slices deep (just for fast testing). I've also tried including all 461 slices but that didn't help. The origin seems to be quite strange. I'm not sure how that came about. Maybe the problem has something to do with that??<br><br>Thanks.<br><br><br>1.2.840.113704.1.111.4496.1160040069.13<br>Image (04C5A390)<br>&nbsp; RTTI typeinfo:&nbsp;&nbsp; class itk::Image&lt;float,3&gt;<br>&nbsp; Reference Count: 3<br>&nbsp; Modified Time: 356<br>&nbsp; Debug: Off<br>&nbsp; Observers:<br>&nbsp;&nbsp;&nbsp; none<br>&nbsp; Source: (04C57C10)<br>&nbsp; Source output index: 0<br>&nbsp; Release Data: Off<br>&nbsp; Data Released: False<br>&nbsp; Global Release Data: Off<br>&nbsp; PipelineMTime: 32<br>&nbsp; UpdateMTime: 357<br>&nbsp; LargestPossibleRegion:<br>&nbsp;&nbsp;&nbsp; Dimension: 3<br>&nbsp;&nbsp;&nbsp; Index: [0, 0, 0]<br>&nbsp;&nbsp;&nbsp; Size: [512, 512, 11]<br>&nbsp; BufferedRegion:<br>&nbsp;&nbsp;&nbsp; Dimension: 3<br>&nbsp;&nbsp;&nbsp; Index: [0, 0, 0]<br>&nbsp;&nbsp;&nbsp; Size: [512, 512, 11]<br>&nbsp; RequestedRegion:<br>&nbsp;&nbsp;&nbsp; Dimension: 3<br>&nbsp;&nbsp;&nbsp; Index: [0, 0, 0]<br>&nbsp;&nbsp;&nbsp; Size: [512, 512, 11]<br>&nbsp; Spacing: [0.71875, 0.71875, 1.5]<br>&nbsp; Origin: [-201, -91, 988.5]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp; Direction:<br>1 0 0<br>0 1 0<br>0 0 1<br><br>&nbsp; PixelContainer:<br>&nbsp;&nbsp;&nbsp; ImportImageContainer (04C5A550)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RTTI typeinfo:&nbsp;&nbsp; class itk::ImportImageContainer&lt;unsigned long,float&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Reference Count: 1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Modified Time: 80<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Debug: Off<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Observers:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; none<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Pointer: 04C5A580<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Container manages memory: true<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Size: 2883584<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Capacity: 2883584<br></div><br><div></div><br><br><hr id="EC_stopSpelling">&gt; Date: Tue, 15 Apr 2008 13:23:16 -0400<br>&gt; From: bill.lorensen@gmail.com<br>&gt; To: w_e_b_m_a_s_t_e_r_6_9@hotmail.com<br>&gt; Subject: Re: [Insight-users] Confidence Connected Seed Coordinates<br>&gt; CC: luis.ibanez@kitware.com; insight-users@itk.org<br>&gt; <br>&gt; Can you print your image please?<br>&gt; <br>&gt; inage-&gt;Print(std::cout);<br>&gt; <br>&gt; On Tue, Apr 15, 2008 at 10:06 AM, Cameron Burnett<br>&gt; &lt;w_e_b_m_a_s_t_e_r_6_9@hotmail.com&gt; wrote:<br>&gt; &gt;<br>&gt; &gt; First of all, thanks to everyone for your help.<br>&gt; &gt;<br>&gt; &gt; I tried to implement the TransformPhysicalPointToIndex function, but the<br>&gt; &gt; indices are totally crazy (as you can see below in the code comments). I've<br>&gt; &gt; put in comments for the output of test message boxes. You can see that the<br>&gt; &gt; point is set up correctly, however the index is insane. The X and Z parts<br>&gt; &gt; always remain at 0, however the Y part is absolutely massive in this<br>&gt; &gt; case.... and often in other parts it just decides to go to -0. I tried<br>&gt; &gt; rounding the pointtype input to int, but that just outputted 0, -0, 0.<br>&gt; &gt;<br>&gt; &gt; The line InternalImageType::ConstPointer image = reader-&gt;GetOutput()   is<br>&gt; &gt; called after the reader-&gt;Update() . The image type at the moment is a 3d<br>&gt; &gt; float. Only the code relevant to the problem has been included also.<br>&gt; &gt;<br>&gt; &gt; I've spent all day trying to figure this out, but it really doesn't make any<br>&gt; &gt; sense to me. I put in a bool isInside to check the transform, but its<br>&gt; &gt; obviously not inside the object when you have numbers like 5e^60.<br>&gt; &gt;<br>&gt; &gt; What is it that I'm doing wrong?? Its exactly the same as in the textbook<br>&gt; &gt; example. Here is the relevant code.....<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;   //InternalImageType is &lt;float,3&gt;<br>&gt; &gt;<br>&gt; &gt;   InternalImageType::PointType  point;<br>&gt; &gt;   point[0] = seedX;      //seedX,Y,Z are float .... but i also tried casting<br>&gt; &gt; to int<br>&gt; &gt;   point[1] = seedY;<br>&gt; &gt;   point[2] = seedZ;<br>&gt; &gt;<br>&gt; &gt;     //output = 95, 147, 7.5 (first 2 i have rounded to the nearest number)<br>&gt; &gt;     CString s;<br>&gt; &gt;     s.Format("%f %f %f",point[0],point[1],point[2]);<br>&gt; &gt;     AfxMessageBox(s);<br>&gt; &gt;<br>&gt; &gt;   InternalImageType::IndexType  index;<br>&gt; &gt;   InternalImageType::ConstPointer image = reader-&gt;GetOutput();<br>&gt; &gt; //reader-&gt;Update() already called<br>&gt; &gt;   image-&gt;TransformPhysicalPointToIndex( point, index );<br>&gt; &gt;<br>&gt; &gt;     //output = 0.0, -285748e^(more than 60 i think), 0.0<br>&gt; &gt;     CString ss;<br>&gt; &gt;     ss.Format("%f %f %f",index[0],index[1],index[2]);<br>&gt; &gt;     AfxMessageBox(ss);<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; Thanks.<br>&gt; &gt; Cameron.<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; ________________________________<br>&gt; &gt; &gt; Date: Mon, 14 Apr 2008 16:23:31 -0400<br>&gt; &gt; &gt; From: luis.ibanez@kitware.com<br>&gt; &gt;<br>&gt; &gt; &gt; To: w_e_b_m_a_s_t_e_r_6_9@hotmail.com<br>&gt; &gt; &gt; CC: bill.lorensen@gmail.com; insight-users@itk.org<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; &gt; Subject: Re: [Insight-users] Confidence Connected Seed Coordinates<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; Hi Cameron,<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; If you want to find the pixel value of an ITK image at a given physical<br>&gt; &gt; &gt; coordinate you may want to consider the two following options:<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; A) ImageType::PointType point = GetPointSomehow();<br>&gt; &gt; &gt; ImageType::IndexType index;<br>&gt; &gt; &gt; ImageType::PixelType pixelValue;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; ImageType::ConstPointer image = seriesReader-&gt;GetOutput();<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; image-&gt;TransformPhysicalPointToIndex( point, index );<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; if( image-&gt;GetBufferedRegion().IsInside(index) )<br>&gt; &gt; &gt; {<br>&gt; &gt; &gt; pixelValue = image-&gt;GetPixel( index );<br>&gt; &gt; &gt; }<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; or<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; B) use the itk::NearestNeighborInterpolateImageFunction<br>&gt; &gt; &gt; as Interpolator type,<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; ImageType::ConstPointer image = seriesReader-&gt;GetOutput();<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; interpolator-&gt;SetImage( image );<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; pixelValue = interpolator-&gt;Evaluate( point );<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;