<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi,<div> </div><div> I know I've know i already asked that, but i was wondering, better hoping that i am doing something wrong:</div><div> I am using a dicom Series of 25 slices of image t2 Head MRT 640x640 </div><div> min gray value = -51</div><div> max gray value = 1359</div><div> I want to use the GeodesicActiveContourFilter, but i get only bad Segmentation results. So i tried to improve the Output of the Sigmoid, which is still partly to dark. I read what it does but still couldn't get good parameters so that the final segmentation is a good one.</div><div> A more important question is this normal that the computation of the sigmoid output in the pipeline step for this filters takes around 3 minutes?</div><div> It is really important for me to know because i intend
to use it on a dicom series of 160 slices.</div><div>This is a part of my code If anyone has an idea why it is so slow please let me know:</div><div><br></div><div>Reading dicom series works just fine and fast</div><div><br></div><div><br></div><div><div>GradientFilterType::Pointer gradientMagnitude = GradientFilterType::New();</div><div> SigmoidFilterType::Pointer sigmoid =
SigmoidFilterType::New();</div><div> sigmoid->SetOutputMinimum(0.0);</div><div> sigmoid->SetOutputMaximum(1.0);</div><div> </div><div> smoothing->SetInput(reader->GetOutput());</div><div> gradientMagnitude->SetInput(smoothing->GetOutput());</div><div> sigmoid->SetInput(gradientMagnitude->GetOutput());</div><div><br></div><div> smoothing->SetTimeStep(0.0625);</div><div> smoothing->SetNumberOfIterations(10);</div><div> smoothing->SetConductanceParameter(1.0);</div><div><br></div><div> const double sigma = 1.0;</div><div> gradientMagnitude->SetSigma(sigma);</div><div><br></div><div> sigmoid->SetAlpha(-6.0);</div><div> sigmoid->SetBeta(30.0);</div><div> std::cout << "I start to do my Stuff " << std::endl <<
std::endl;</div><div> CastFilterType::Pointer caster1 = CastFilterType::New();</div><div> ……….</div><div> WriterTypeChar::Pointer writerfinal = WriterTypeChar::New();</div><div>ImageType::Pointer localImage = reader->GetOutput();</div><div>typedef itk::FastMarchingImageFilter<ImageType,ImageType > FastMarchingFilterType;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>FastMarchingFilterType::Pointer fastMarching = FastMarchingFilterType::New();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>typedef itk::GeodesicActiveContourLevelSetImageFilter< ImageType,ImageType > GeodesicActiveContourFilterType;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>GeodesicActiveContourFilterType::Pointer geodesicActiveContour = GeodesicActiveContourFilterType::New();</div><div><span
class="Apple-tab-span" style="white-space:pre">                </span></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>const double propagationScaling = 10.0;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span></div><div><span class="Apple-tab-span" style="white-space:pre">                </span></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>geodesicActiveContour->SetPropagationScaling(propagationScaling);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>geodesicActiveContour->SetCurvatureScaling(1.0);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>geodesicActiveContour->SetAdvectionScaling( 1.0 );</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>geodesicActiveContour->SetMaximumRMSError( 0.02 );</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>geodesicActiveContour->SetNumberOfIterations( 120
);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>geodesicActiveContour->SetInput( fastMarching->GetOutput() );</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>geodesicActiveContour->SetFeatureImage( sigmoid->GetOutput() );</div><div><span class="Apple-tab-span" style="white-space:pre">                </span></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>thresholder->SetInput( geodesicActiveContour->GetOutput() );</div><div><span class="Apple-tab-span" style="white-space:pre">                </span></div><div><span class="Apple-tab-span" style="white-space:pre">                </span></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>ImageType::IndexType index1;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>index1[0] = 381;</div><div><span class="Apple-tab-span"
style="white-space:pre">                </span>index1[1] = 423;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>index1[2] = 14;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>ImageType::IndexType index2;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>index2[0] = 260;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>index2[1] = 413;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>index2[2] = 14;<span class="Apple-tab-span" style="white-space:pre">                </span></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>typedef FastMarchingFilterType::NodeContainer NodeContainer;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>typedef FastMarchingFilterType::NodeType NodeType; </div><div><span class="Apple-tab-span" style="white-space:pre">                </span>NodeContainer::Pointer seeds =
NodeContainer::New();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>double initialDistance = 5.0;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>double seedValue = -initialDistance;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>NodeType node1;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>node1.SetValue(seedValue);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>node1.SetIndex(index1);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>seeds->Initialize();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>seeds->InsertElement(0,node1);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>NodeType node2;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>node2.SetValue(seedValue);</div><div><span class="Apple-tab-span"
style="white-space:pre">                </span>node2.SetIndex(index2);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>seeds->InsertElement(1,node2);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>fastMarching->SetTrialPoints(seeds);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>fastMarching->SetSpeedConstant(1.0);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>fastMarching->SetOutputSize(reader->GetOutput()->GetBufferedRegion().GetSize());</div><div><span class="Apple-tab-span" style="white-space:pre">                </span></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>std::cout << "Fast Marching started " << std::endl << std::endl;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>caster4->SetInput( fastMarching->GetOutput() );</div><div><span class="Apple-tab-span" style="white-space:pre">        
        </span>writer4->SetInput( caster4->GetOutput() );</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>char *name4 = "/Users/ellaK/Documents/DicomRead/FFM.gipl";</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>writer4->SetFileName(name4);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>caster4->SetOutputMinimum( 0 );</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>caster4->SetOutputMaximum( 255 );<span class="Apple-tab-span" style="white-space:pre">                </span></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>try{</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>writer4->Update();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>catch( itk::ExceptionObject & excep ){</div><div><span
class="Apple-tab-span" style="white-space:pre">                        </span>std::cerr << "Exception caught at writer1!" << std::endl;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>std::cerr << excep << std::endl;</div><div> }</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>writerfinal->SetInput(thresholder->GetOutput());</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>char *name6 = "/Users/ellaK/Documents/DicomRead/Segmentation.gipl";</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>writerfinal->SetFileName(name6);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>try</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>{</div><div><span class="Apple-tab-span"
style="white-space:pre">                </span>writerfinal->Update();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>catch( itk::ExceptionObject & excep )</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>std::cerr << "Exception caught at writerfinal!" << std::endl;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>std::cerr << excep << std::endl;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>} </div><div>}</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span></div><div><br></div><div><br></div></div><div> </div></td></tr></table><br>