-
- // Loop on all orientations
- for(int i=0; i<m_ListOfAngles.size(); i++) {
-
- // Compute Fuzzy map
- typename FloatImageType::Pointer map = ComputeFuzzyMap(objectLikeTarget, m_Target, m_ListOfAngles[i]);
- writeImage<FloatImageType>(map, "fuzzy_"+toString(i)+".mha");
-
- // Compute the optimal thresholds (direct and inverse)
- double mThreshold;
- double mReverseThreshold;
- int bins = this->GetAFDB()->GetDouble("bins");
- double tolerance = this->GetAFDB()->GetDouble("TargetAreaLossTolerance");
- ComputeOptimalThresholds(map, m_Target, bins, tolerance, mThreshold, mReverseThreshold);
-
- // Use the threshold to compute new support
- int s1;
- if (mThreshold > 0.0) {
- ImagePointer support1 =
- clitk::SliceBySliceRelativePosition<ImageType>(m_Support, m_Object, 2,
- mThreshold,
- m_ListOfAngles[i],false,
- false, -1, true, false);
- writeImage<ImageType>(support1, "sup_"+toString(i)+".mha");
- // Compute the new support size
- statFilter->SetInput(support1);
- statFilter->SetLabelInput(support1);
- statFilter->Update();
- s1 = statFilter->GetCount(GetForegroundValue());
- }
- else s1 = m_SupportSize;
-
- int s2;
- if (mReverseThreshold < 1.0) {
- ImagePointer support2 =
- clitk::SliceBySliceRelativePosition<ImageType>(m_Support, m_Object, 2,
- mReverseThreshold,
- m_ListOfAngles[i],true,
- false, -1, true, false);
- writeImage<ImageType>(support2, "sup_rev_"+toString(i)+".mha");
- // Compute the new support size
- statFilter = StatFilterType::New();
- statFilter->SetInput(support2);
- statFilter->SetLabelInput(support2);
- statFilter->Update();
- s2 = statFilter->GetCount(GetForegroundValue());
- }
- else s2 =m_SupportSize;
-
- // Print results
- std::cout << i << " " << clitk::rad2deg(m_ListOfAngles[i]) << "\t"
- << m_SupportSize << " " << m_TargetSize << "\t"
- << s1/(double)m_SupportSize << " " << s2/(double)m_SupportSize << "\t"
- << mThreshold << " " << mReverseThreshold << std::endl;
-
- } // end loop on orientations
-