option "doNotFillHoles" - "Do not fill holes if set" flag on
option "dir" d "Directions (axes) to perform filling (defaults to 2,1,0)" int multiple no
+option "noAutoCrop" - "If set : do no crop final mask to BoundingBox" flag off
itkGetConstMacro(FillHolesFlag, bool);
itkBooleanMacro(FillHolesFlag);
+ // Step Auto Crop
+ itkSetMacro(AutoCrop, bool);
+ itkGetConstMacro(AutoCrop, bool);
+ itkBooleanMacro(AutoCrop);
+
protected:
ExtractLungFilter();
virtual ~ExtractLungFilter() {}
MaskImagePixelType m_BackgroundValue;
MaskImagePixelType m_ForegroundValue;
int m_MinimalComponentSize;
+ bool m_AutoCrop;
// Step 1
InputImagePixelType m_UpperThreshold;
// Step 6
FillHolesFlagOn();
+ AutoCropOn();
}
//--------------------------------------------------------------------
//--------------------------------------------------------------------
PrintMemory(GetVerboseMemoryFlag(), "before autocropfilter");
if (m_Seeds.size() != 0) { // if ==0 ->no trachea found
- trachea = clitk::AutoCrop<MaskImageType>(trachea, GetBackgroundValue());
+ if (GetAutoCrop())
+ trachea = clitk::AutoCrop<MaskImageType>(trachea, GetBackgroundValue());
StopCurrentStep<MaskImageType>(trachea);
PrintMemory(GetVerboseMemoryFlag(), "after delete trachea");
}
//--------------------------------------------------------------------
StartNewStep("Cropping lung");
PrintMemory(GetVerboseMemoryFlag(), "Before Autocropfilter");
- working_mask = clitk::AutoCrop<MaskImageType>(working_mask, GetBackgroundValue());
+ if (GetAutoCrop())
+ working_mask = clitk::AutoCrop<MaskImageType>(working_mask, GetBackgroundValue());
StopCurrentStep<MaskImageType>(working_mask);
//--------------------------------------------------------------------
f->SetOpenCloseFlag(mArgsInfo.openclose_flag);
f->SetOpenCloseRadius(mArgsInfo.opencloseRadius_arg);
+ f->SetAutoCrop(!mArgsInfo.noAutoCrop_flag);
if (mArgsInfo.doNotFillHoles_given)
f->SetFillHolesFlag(false);