notice something:<br><pre>(1)<br>if the ExternalImageType used as float, the image of result will be white<br>entirely in every step (smooth,gradient and sigmoid).<br><br>(2)<br>And if both ExternalImageType and InternalImageType are signed short,
<br>the image of smooth and gradient are fine but sigmoid image is whole white.</pre>(3) Unfortunately , the format for level set must be float.<br>How do I solve this problem???<br><br><br><div><span class="gmail_quote">
2007/3/27, Goo <<a href="mailto:gtshowtime@gmail.com">gtshowtime@gmail.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi All:<br><br>This question is so confused to me.<br>The output of sigmoid image is shown white entirely but gradient image fine.<br><br><div dir="ltr">The following are my programs:<br>if the ExternalImageType used as float, the image of result will be white entirely in smooth,gradient and sigmoid.
<br></div><br>Please give me some guidance.<br>Regards.<br><br>//----------------------------------CODE-------------------------------------------<br><br> typedef itk::Image< signed short, 3 > InternalImageType;
<br> typedef itk::Image< signed short, 3 > ExternalImageType;<br><br> typedef itk::RescaleIntensityImageFilter<ExternalImageType, InternalImageType> InputCastType;<br> typedef itk::RescaleIntensityImageFilter<InternalImageType, ExternalImageType> OutputCastType;
<br><br> OutputCastType::Pointer m_SmoothObserver;<br> OutputCastType::Pointer m_GradientObserver;<br> OutputCastType::Pointer m_SigmoidObserver;<br><br> typedef itk::ResampleImageFilter<
<br> InternalImageType , InternalImageType > FilterType;<br> FilterType::Pointer SubSample = FilterType::New();<br><br> typedef itk::AffineTransform< double, 3 > TransformType;
<br> TransformType::Pointer transform = TransformType::New();<br><br> typedef itk::NearestNeighborInterpolateImageFunction< <br> InternalImageType, double > InterpolatorType;
<br> InterpolatorType::Pointer interpolator = InterpolatorType::New(); <br><br> SubSample->SetInterpolator( interpolator );<br> SubSample->SetDefaultPixelValue( 50 );<br><br> double spacing[ 3 ];
<br> spacing[0] = InputCaster->GetOutput()->GetSpacing()[0];<br> spacing[1] = InputCaster->GetOutput()->GetSpacing()[1];<br> spacing[2] = InputCaster->GetOutput()->GetSpacing()[2];<br>
SubSample->SetOutputSpacing( spacing );<br><br> double origin [3];<br> origin[0] = 80*spacing[0];<br> origin[1] = 80*spacing[1];<br> origin[2] = 15*spacing[2];<br> SubSample->SetOutputOrigin(origin);
<br><br> InternalImageType::SizeType size;<br><br> size[0] = 100; <br> size[1] = 100;<br> size[2] = 5;<br><br> SubSample->SetSize( size );<br> SubSample->SetInput( InputCaster->GetOutput() );
<br> SubSample->SetTransform( transform );<br> transform->SetIdentity();<br><br> SubSample->Update();<br><br><br> typedef itk::CurvatureAnisotropicDiffusionImageFilter<br> < InternalImageType,InternalImageType > SmoothingFilterType;
<br> <br> typedef itk::GradientMagnitudeRecursiveGaussianImageFilter<br> < InternalImageType,InternalImageType > GradientFilterType;<br><br> typedef itk::SigmoidImageFilter<br>
< InternalImageType,InternalImageType > SigmoidFilterType;<br><br> SmoothingFilterType::Pointer m_smoothing = SmoothingFilterType::New(); <br> GradientFilterType::Pointer m_gradientMagnitude = GradientFilterType::New();
<br> SigmoidFilterType::Pointer m_sigmoid = SigmoidFilterType::New(); <br><br> m_smoothing->SetNumberOfIterations( m_SmoothIter );<br> m_smoothing->SetConductanceParameter( m_SmoothConductance );
<br> m_smoothing->SetTimeStep( m_TimeStep );<br><br> m_gradientMagnitude->SetSigma( m_sigma );<br><br> m_sigmoid->SetOutputMinimum( m_SigmoidOutMin );<br> m_sigmoid->SetOutputMaximum( m_SigmoidOutMax );
<br> m_sigmoid->SetAlpha( m_alpha );<br> m_sigmoid->SetBeta( m_beta );<br><br> m_smoothing->SetInput( SubSample->GetOutput() );<br> m_gradientMagnitude->SetInput( m_smoothing->GetOutput() );
<br> m_sigmoid->SetInput( m_gradientMagnitude->GetOutput() );<br><br> m_SmoothObserver->SetInput(m_smoothing->GetOutput());<br> m_GradientObserver->SetInput(m_gradientMagnitude->GetOutput());
<br> m_SigmoidObserver->SetInput(m_sigmoid->GetOutput());<br><br> m_SmoothObserver->Update();<br> m_GradientObserver->Update();<br> m_SigmoidObserver->Update();<br>
</blockquote></div><br>