X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=itk%2FclitkSliceBySliceRelativePositionFilter.txx;h=6a4b0f49ab507a089842ef723ab58f169f3ac61f;hb=8ce049c3b7fbb418f7fb106c726bc0bf37c06e12;hp=e3801024bf389f93a0188ae367afb6ae168107a7;hpb=72375037f90c596a034b2ebe5e54e209e7b45511;p=clitk.git diff --git a/itk/clitkSliceBySliceRelativePositionFilter.txx b/itk/clitkSliceBySliceRelativePositionFilter.txx index e380102..6a4b0f4 100644 --- a/itk/clitkSliceBySliceRelativePositionFilter.txx +++ b/itk/clitkSliceBySliceRelativePositionFilter.txx @@ -32,7 +32,11 @@ SliceBySliceRelativePositionFilter(): { SetDirection(2); UniqueConnectedComponentBySliceOff(); - SetIgnoreEmptySliceObject(false); + SetIgnoreEmptySliceObjectFlag(false); + UseASingleObjectConnectedComponentBySliceFlagOn(); + this->VerboseStepFlagOff(); + this->WriteStepFlagOff(); + this->SetCombineWithOrFlag(false); } //-------------------------------------------------------------------- @@ -70,7 +74,7 @@ PrintOptions() DD(this->GetDirection()); DD((int)this->GetObjectBackgroundValue()); DDV(this->GetOrientationTypeString(), (uint)this->GetNumberOfAngles()); - DD(this->GetResampleBeforeRelativePositionFilter()); + DD(this->GetIntermediateSpacingFlag()); DD(this->GetIntermediateSpacing()); DD(this->GetFuzzyThreshold()); DD(this->GetUniqueConnectedComponentBySlice()); @@ -172,18 +176,23 @@ GenerateOutputInformation() // Perform slice by slice relative position this->StartNewStep("Perform slice by slice relative position"); for(unsigned int i=0; i(mObjectSlices[i], 0, true, 1, nb); - if ((!GetIgnoreEmptySliceObject()) || (nb!=0)) { - mObjectSlices[i] = KeepLabels(mObjectSlices[i], 0, 1, 1, 1, true); + if ((!GetIgnoreEmptySliceObjectFlag()) || (nb!=0)) { + + // Select or not a single CCL ? + if (GetUseASingleObjectConnectedComponentBySliceFlag()) { + mObjectSlices[i] = KeepLabels(mObjectSlices[i], 0, 1, 1, 1, true); + } // Relative position typedef clitk::AddRelativePositionConstraintToLabelImageFilter RelPosFilterType; typename RelPosFilterType::Pointer relPosFilter = RelPosFilterType::New(); + relPosFilter->VerboseStepFlagOff(); relPosFilter->WriteStepFlagOff(); - relPosFilter->SetCurrentStepBaseId(this->GetCurrentStepId()); relPosFilter->SetBackgroundValue(this->GetBackgroundValue()); relPosFilter->SetInput(mInputSlices[i]); relPosFilter->SetInputObject(mObjectSlices[i]); @@ -194,7 +203,7 @@ GenerateOutputInformation() relPosFilter->SetInverseOrientationFlag(this->GetInverseOrientationFlag()); //relPosFilter->SetOrientationType(this->GetOrientationType()); relPosFilter->SetIntermediateSpacing(this->GetIntermediateSpacing()); - relPosFilter->SetResampleBeforeRelativePositionFilter(this->GetResampleBeforeRelativePositionFilter()); + relPosFilter->SetIntermediateSpacingFlag(this->GetIntermediateSpacingFlag()); relPosFilter->SetFuzzyThreshold(this->GetFuzzyThreshold()); relPosFilter->AutoCropFlagOff(); // important ! because we join the slices after this loop relPosFilter->SetCombineWithOrFlag(this->GetCombineWithOrFlag());