option "upperThresholdForTrachea" - "0: Initial upper threshold for trachea" double no default="-900"
option "multiplierForTrachea" - "0: Multiplier for the region growing" double no default="5"
option "thresholdStepSizeForTrachea" - "0: Threshold step size" int no default="64"
-option "seed" - "0,1: Index of the trachea seed point (in pixel, not in mm)" int no multiple
+option "seed" - "0,1: Index of the trachea seed point (in mm NOT IN PIXELS)" float no multiple
option "doNotCheckTracheaVolume" - "0,1: If set, do not check the trachea volume" flag off
option "verboseRG" - "0,1: Verbose RegionGrowing" flag off
option "maxElongation" - "1: Maximum allowed elongation of candidate regions for the trachea" float no default="0.5"
section "Step 6 : fill holes"
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 "dir" d "Directions (axes) to perform filling (defaults to 2,1,0)" int multiple no
section "Step 7 : lung separation (labelling)"
option "doNotSeparateLungs" - "Do not separate lungs if set" flag off
itkSetMacro(SeedPreProcessingThreshold, int);
itkGetConstMacro(SeedPreProcessingThreshold, int);
- void AddSeed(InternalIndexType s);
+ void AddSeedInPixels(InternalIndexType s);
+ void AddSeed(InputImagePointType s);
std::vector<InternalIndexType> & GetSeeds() { return m_Seeds; }
itkSetMacro(TracheaVolumeMustBeCheckedFlag, bool);
InputImagePixelType m_ThresholdStepSizeForTrachea;
double m_MultiplierForTrachea;
std::vector<InternalIndexType> m_Seeds;
+ std::vector<InputImagePointType> m_SeedsInMM;
int m_NumberOfSlicesToSkipBeforeSearchingSeed;
bool m_TracheaVolumeMustBeCheckedFlag;
bool m_VerboseRegionGrowingFlag;
TracheaVolumeMustBeCheckedFlagOn();
SetNumSlices(50);
SetMaxElongation(0.5);
- SetSeedPreProcessingThreshold(-400);
-
+ SetSeedPreProcessingThreshold(-400);
// Step 3 default values
SetNumberOfHistogramBins(500);
template <class ImageType>
void
clitk::ExtractLungFilter<ImageType>::
-AddSeed(InternalIndexType s)
+//AddSeed(InternalIndexType s)
+AddSeed(InputImagePointType s)
+{
+ m_SeedsInMM.push_back(s);
+}
+//--------------------------------------------------------------------
+
+
+//--------------------------------------------------------------------
+template <class ImageType>
+void
+clitk::ExtractLungFilter<ImageType>::
+AddSeedInPixels(InternalIndexType s)
{
m_Seeds.push_back(s);
}
// smalest one (sometimes appends with the stomach
if (initialNumberOfLabels >1) {
if (GetRemoveSmallLabelBeforeSeparationFlag()) {
- DD(GetRemoveSmallLabelBeforeSeparationFlag());
typedef itk::RelabelComponentImageFilter<MaskImageType, MaskImageType> RelabelFilterType;
typename RelabelFilterType::Pointer relabelFilter = RelabelFilterType::New();
relabelFilter->SetInput(working_mask);
it.GoToBegin();
while (!it.IsAtEnd()) {
if(it.Get() < GetUpperThresholdForTrachea() ) {
- AddSeed(it.GetIndex());
+ AddSeedInPixels(it.GetIndex());
// DD(it.GetIndex());
}
++it;
f->SetVerbose(GetVerboseRegionGrowingFlag());
for(unsigned int i=0; i<m_Seeds.size();i++) {
f->AddSeed(m_Seeds[i]);
- // DD(m_Seeds[i]);
+ //DD(m_Seeds[i]);
}
f->Update();
PrintMemory(GetVerboseMemoryFlag(), "After RG update");
// compute trachea volume
// if volume not plausible -> skip more slices and restart
+ // If initial seed, convert from mm to pixels
+ if (m_SeedsInMM.size() > 0) {
+ for(unsigned int i=0; i<m_SeedsInMM.size(); i++) {
+ InputImageIndexType index;
+ working_input->TransformPhysicalPointToIndex(m_SeedsInMM[i], index);
+ m_Seeds.push_back(index);
+ }
+ }
+
bool has_seed;
bool stop = false;
double volume = 0.0;
f->SetMaxElongation(mArgsInfo.maxElongation_arg);
f->SetSeedPreProcessingThreshold(mArgsInfo.seedPreProcessingThreshold_arg);
- typename FilterType::InputImageIndexType s;
+ typename FilterType::InputImagePointType s;
if (mArgsInfo.seed_given) {
ConvertOptionMacro(mArgsInfo.seed, s, 3, false);
- f->AddSeed(s);
+ f->AddSeed(s);
}
f->SetMinimalComponentSize(mArgsInfo.minSize_arg);