- typename ImageMaskSpatialObjectType::ConstPointer mask = dynamic_cast<const ImageMaskSpatialObjectType*>(m_FixedImageMask.GetPointer());
-
+ typename ImageMaskSpatialObjectType::ConstPointer mask = NULL;
+ if (m_FixedImageMask.IsNotNull())
+ mask = dynamic_cast<const ImageMaskSpatialObjectType*>(m_FixedImageMask.GetPointer());
+
//============================================================================
// Set the lower intensity threshold
//============================================================================
// Set the lower intensity threshold
const unsigned int numberOfDemandedPixels = static_cast< unsigned int >( (double) totalNumberOfPixels *m_ArgsInfo.samples_arg );
// --------------------------------------------------
const unsigned int numberOfDemandedPixels = static_cast< unsigned int >( (double) totalNumberOfPixels *m_ArgsInfo.samples_arg );
// --------------------------------------------------
if( m_UseFixedImageSamplesIntensityThreshold &&
( regionIter.Get() < m_FixedImageSamplesIntensityThreshold) ) {
++regionIter; // jump to next pixel
continue;
}
if( m_UseFixedImageSamplesIntensityThreshold &&
( regionIter.Get() < m_FixedImageSamplesIntensityThreshold) ) {
++regionIter; // jump to next pixel
continue;
}
- if( m_UseFixedImageSamplesIntensityThreshold &&
- randIter.Get() < m_FixedImageSamplesIntensityThreshold ) {
- ++randIter;
- //if (m_Verbose) std::cout << "not in threshold" << std::endl;
- count_not_thres++;
- continue;
- }
+// if( m_UseFixedImageSamplesIntensityThreshold &&
+// randIter.Get() < m_FixedImageSamplesIntensityThreshold ) {
+// ++randIter;
+// //if (m_Verbose) std::cout << "not in threshold" << std::endl;
+// count_not_thres++;
+// continue;
+// }
if (m_Verbose) std::cout<<"A fraction of "<<m_ArgsInfo.samples_arg<<" spatial samples was requested..."<<std::endl;
double fraction=(double)numberOfValidPixels/ (double) totalNumberOfPixels;
if (m_Verbose) std::cout<<"Found "<<numberOfValidPixels <<" valid pixels for a total of "<<totalNumberOfPixels<<" (a fraction of "<<fraction<<")..."<<std::endl;
if (m_Verbose) std::cout<<"A fraction of "<<m_ArgsInfo.samples_arg<<" spatial samples was requested..."<<std::endl;
double fraction=(double)numberOfValidPixels/ (double) totalNumberOfPixels;
if (m_Verbose) std::cout<<"Found "<<numberOfValidPixels <<" valid pixels for a total of "<<totalNumberOfPixels<<" (a fraction of "<<fraction<<")..."<<std::endl;