Hi, <br> In your program, you just comment <br> fastMarching->SetInput(image);<br>it will works since you have set the constant speed. <br><br>The input image is speed image for fast marching filter, if you want use it, you should initialize it.<br>
<br>hope it helps<br><br><br>nadan<br><br><br><br><div class="gmail_quote">On Fri, Apr 30, 2010 at 8:23 AM, Haiyong Xu <span dir="ltr"><<a href="mailto:haiyeong@gmail.com">haiyeong@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi List,<br>
<br>
I tried to use FastMarchingImageFilter with a constant speed to<br>
generate initial levelsets. It works very well in 2D but very slow in<br>
3D. For a relative small 3D image data (60x60x60), I run the program<br>
for 3~5 minutes and there is no result. Is that intrinsic property of<br>
FastMarchingImageFilter or my mistake in programing?<br>
<br>
Below is a test program:<br>
<br>
int main( int argc, char *argv[] )<br>
{<br>
typedef itk::Image<float, 3> ImageType;<br>
<br>
// set up input image<br>
ImageType::Pointer image = ImageType::New();<br>
ImageType::RegionType region;<br>
ImageType::IndexType index;<br>
index[0] = index[1] = index[2] = 0;<br>
ImageType::SizeType size;<br>
size[0] = 60; size[1] = 60; size[2] = 60;<br>
region.SetIndex(index);<br>
region.SetSize(size);<br>
image->SetRegions(region);<br>
image->Allocate();<br>
<br>
// create filter and set initial point<br>
typedef itk::FastMarchingImageFilter< ImageType, ImageType ><br>
FastMarchingFilterType;<br>
FastMarchingFilterType::Pointer fastMarching = FastMarchingFilterType::New();<br>
<br>
ImageType::IndexType seedPosition;<br>
seedPosition[0] = 30; seedPosition[1] = 30; seedPosition[2] = 30;<br>
<br>
typedef FastMarchingFilterType::NodeContainer NodeContainer;<br>
NodeContainer::Pointer seeds = NodeContainer::New();<br>
<br>
FastMarchingFilterType::NodeType node;<br>
node.SetValue( 0 );<br>
node.SetIndex( seedPosition );<br>
seeds->Initialize();<br>
seeds->InsertElement( 0, node );<br>
<br>
fastMarching->SetInput(image);<br>
fastMarching->SetOutputSize(size);<br>
fastMarching->SetTrialPoints( seeds );<br>
fastMarching->SetSpeedConstant(1.0);<br>
//fastMarching->SetStoppingValue(10);<br>
<br>
fastMarching->Update();<br>
<br>
return 0;<br>
}<br>
<br>
<br>
The program was built upon ITK 3.16 and run on Windows XP.<br>
<br>
Thanks for help.<br>
<br>
--Haiyong<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote></div><br>