X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=itk%2FclitkSliceBySliceRelativePositionFilter.txx;h=e68514da031c0f6f1a6725a2df78f97d0c189fe7;hb=0608e5a94e72e6c2ae9a1de81657b1f48ed61c3b;hp=eff331daa9e6d99269629f4ba6f112aca2fcec96;hpb=7710267bd8a9764984655596ff14307b4a8a9884;p=clitk.git diff --git a/itk/clitkSliceBySliceRelativePositionFilter.txx b/itk/clitkSliceBySliceRelativePositionFilter.txx index eff331d..e68514d 100644 --- a/itk/clitkSliceBySliceRelativePositionFilter.txx +++ b/itk/clitkSliceBySliceRelativePositionFilter.txx @@ -42,6 +42,7 @@ SliceBySliceRelativePositionFilter(): SetObjectCCLSelectionDimension(0); SetObjectCCLSelectionDirection(1); ObjectCCLSelectionIgnoreSingleCCLFlagOff(); + VerboseSlicesFlagOff(); } //-------------------------------------------------------------------- @@ -77,7 +78,7 @@ clitk::SliceBySliceRelativePositionFilter:: PrintOptions(std::ostream & os) { os << "Slice direction = " << this->GetDirection() << std::endl - << "BG value = " << this->GetBackgroundValue() << std::endl; + << "BG value = " << (int)this->GetBackgroundValue() << std::endl; for(int i=0; iGetNumberOfAngles(); i++) { os << "Orientation = " << this->GetOrientationTypeString()[i] << std::endl; os << "Angles = " << clitk::rad2deg(this->GetAngle1InRad(i)) @@ -182,6 +183,11 @@ GenerateOutputInformation() m_working_input, this->GetObjectBackgroundValue()); + // Index can be negative in some cases, and lead to problem with + // some filter. So we correct it. + m_working_input = clitk::RemoveNegativeIndexFromRegion(m_working_input); + m_working_object = clitk::RemoveNegativeIndexFromRegion(m_working_object); + // End this->template StopCurrentStep(m_working_input); } @@ -286,6 +292,10 @@ GenerateOutputInformation() typedef clitk::AddRelativePositionConstraintToLabelImageFilter RelPosFilterType; typename RelPosFilterType::Pointer relPosFilter = RelPosFilterType::New(); relPosFilter->VerboseStepFlagOff(); + if (GetVerboseSlicesFlag()) { + std::cout << "Slice " << i << std::endl; + relPosFilter->VerboseStepFlagOn(); + } relPosFilter->WriteStepFlagOff(); // relPosFilter->VerboseMemoryFlagOn(); relPosFilter->SetCurrentStepBaseId(this->GetCurrentStepId()+"-"+toString(i));