+++ /dev/null
-/*=========================================================================
- Program: vv http://www.creatis.insa-lyon.fr/rio/vv
-
- Authors belong to:
- - University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://www.centreleonberard.fr
- - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the copyright notices for more information.
-
- It is distributed under dual licence
-
- - BSD See included LICENSE.txt file
- - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
- ===========================================================================**/
-
-#ifndef CLITKRELATIVEPOSITIONANALYZERFILTER_H
-#define CLITKRELATIVEPOSITIONANALYZERFILTER_H
-
-// clitk
-#include "clitkFilterWithAnatomicalFeatureDatabaseManagement.h"
-#include "clitkFilterBase.h"
-#include "clitkSliceBySliceRelativePositionFilter.h"
-#include "clitkRelativePositionDataBase.h"
-
-// itk
-#include <itkImageToImageFilter.h>
-#include <itkLabelStatisticsImageFilter.h>
-
-namespace clitk {
-
- //--------------------------------------------------------------------
- /*
- Analyze the relative position of a Target (mask image) according
- to some Object (mask image), in a given Support (mask
- image). Compute the optimal threshold allowing to remove the
- maximal area from the Support without removing area belonging to
- the Target.
- */
- //--------------------------------------------------------------------
-
- template <class ImageType>
- class RelativePositionAnalyzerFilter:
- public itk::ImageToImageFilter<ImageType, ImageType>
- {
-
- public:
- /** Standard class typedefs. */
- typedef itk::ImageToImageFilter<ImageType, ImageType> Superclass;
- typedef RelativePositionAnalyzerFilter<ImageType> Self;
- typedef itk::SmartPointer<Self> Pointer;
- typedef itk::SmartPointer<const Self> ConstPointer;
-
- /** Method for creation through the object factory. */
- itkNewMacro(Self);
-
- /** Run-time type information (and related methods). */
- itkTypeMacro(RelativePositionAnalyzerFilter, ImageToImageFilter);
-
- /** Some convenient typedefs. */
- typedef typename ImageType::ConstPointer ImageConstPointer;
- typedef typename ImageType::Pointer ImagePointer;
- typedef typename ImageType::RegionType RegionType;
- typedef typename ImageType::PixelType PixelType;
- typedef typename ImageType::SpacingType SpacingType;
- typedef typename ImageType::SizeType SizeType;
- typedef typename ImageType::IndexType IndexType;
- typedef typename ImageType::PointType PointType;
-
- /** ImageDimension constants */
- itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
- FILTERBASE_INIT;
- typedef itk::Image<float, ImageDimension> FloatImageType;
-
- /** Input : initial image and object */
- void SetInputSupport(const ImageType * image);
- void SetInputObject(const ImageType * image);
- void SetInputTarget(const ImageType * image);
-
- // Input
- // supportname, objectname multiple targetname
-
- // Options
- itkGetConstMacro(BackgroundValue, PixelType);
- itkSetMacro(BackgroundValue, PixelType);
-
- itkGetConstMacro(ForegroundValue, PixelType);
- itkSetMacro(ForegroundValue, PixelType);
-
- clitk::RelativePositionDirectionType & GetDirection() { return m_Direction; }
- void SetDirection(clitk::RelativePositionDirectionType & d) { m_Direction = d; }
-
- itkGetConstMacro(NumberOfBins, int);
- itkSetMacro(NumberOfBins, int);
-
- itkGetConstMacro(AreaLossTolerance, double);
- itkSetMacro(AreaLossTolerance, double);
-
- itkGetConstMacro(SupportSize, int);
- itkGetConstMacro(TargetSize, int);
- itkGetConstMacro(SizeWithThreshold, int);
- itkGetConstMacro(SizeWithReverseThreshold, int);
-
- itkGetConstMacro(Info, clitk::RelativePositionInformationType);
- itkGetConstMacro(InfoReverse, clitk::RelativePositionInformationType);
-
- // For debug
- void PrintOptions();
-
- // Print output
- void Print(std::ostream & os=std::cout);
-
- // I dont want to verify inputs information
- virtual void VerifyInputInformation() { }
-
- protected:
- RelativePositionAnalyzerFilter();
- virtual ~RelativePositionAnalyzerFilter() {}
-
- itkSetMacro(SupportSize, int);
- itkSetMacro(TargetSize, int);
- itkSetMacro(SizeWithThreshold, int);
- itkSetMacro(SizeWithReverseThreshold, int);
-
- PixelType m_BackgroundValue;
- PixelType m_ForegroundValue;
- ImagePointer m_Support;
- ImagePointer m_Object;
- ImagePointer m_Target;
- int m_NumberOfBins;
- double m_AreaLossTolerance;
- int m_SupportSize;
- int m_TargetSize;
- int m_SizeWithReverseThreshold;
- int m_SizeWithThreshold;
- clitk::RelativePositionDirectionType m_Direction;
- clitk::RelativePositionInformationType m_Info;
- clitk::RelativePositionInformationType m_InfoReverse;
-
- virtual void GenerateOutputInformation();
- virtual void GenerateData();
-
- typename FloatImageType::Pointer
- ComputeFuzzyMap(ImageType * object, ImageType * target, ImageType * support, double angle);
-
- void
- ComputeOptimalThresholds(FloatImageType * map, ImageType * target, int bins, double tolerance,
- double & threshold, double & reverseThreshold);
- private:
- RelativePositionAnalyzerFilter(const Self&); //purposely not implemented
- void operator=(const Self&); //purposely not implemented
-
- }; // end class
- //--------------------------------------------------------------------
-
-} // end namespace clitk
-//--------------------------------------------------------------------
-
-#include "clitkRelativePositionAnalyzerFilter.txx"
-
-#endif
+++ /dev/null
-/*=========================================================================
- Program: vv http://www.creatis.insa-lyon.fr/rio/vv
-
- Authors belong to:
- - University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://www.centreleonberard.fr
- - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the copyright notices for more information.
-
- It is distributed under dual licence
-
- - BSD See included LICENSE.txt file
- - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
- ===========================================================================**/
-
-//--------------------------------------------------------------------
-template <class ImageType>
-clitk::RelativePositionAnalyzerFilter<ImageType>::
-RelativePositionAnalyzerFilter():
- itk::ImageToImageFilter<ImageType, ImageType>()
-{
- this->SetNumberOfRequiredInputs(3); // Input : support, object, target
- SetBackgroundValue(0);
- SetForegroundValue(1);
- SetNumberOfBins(100);
- SetAreaLossTolerance(0.01);
- SetSupportSize(0);
- SetTargetSize(0);
- SetSizeWithThreshold(0);
- SetSizeWithReverseThreshold(0);
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template <class ImageType>
-void
-clitk::RelativePositionAnalyzerFilter<ImageType>::
-SetInputSupport(const ImageType * image)
-{
- // Process object is not const-correct so the const casting is required.
- this->SetNthInput(0, const_cast<ImageType *>(image));
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template <class ImageType>
-void
-clitk::RelativePositionAnalyzerFilter<ImageType>::
-SetInputObject(const ImageType * image)
-{
- // Process object is not const-correct so the const casting is required.
- this->SetNthInput(1, const_cast<ImageType *>(image));
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template <class ImageType>
-void
-clitk::RelativePositionAnalyzerFilter<ImageType>::
-SetInputTarget(const ImageType * image)
-{
- // Process object is not const-correct so the const casting is required.
- this->SetNthInput(2, const_cast<ImageType *>(image));
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template <class ImageType>
-void
-clitk::RelativePositionAnalyzerFilter<ImageType>::
-PrintOptions()
-{
- DD("TODO");
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template <class ImageType>
-void
-clitk::RelativePositionAnalyzerFilter<ImageType>::
-GenerateOutputInformation()
-{
- ImagePointer input = dynamic_cast<ImageType*>(itk::ProcessObject::GetInput(0));
- ImagePointer outputImage = this->GetOutput(0);
- outputImage->SetRegions(outputImage->GetLargestPossibleRegion());
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template <class ImageType>
-void
-clitk::RelativePositionAnalyzerFilter<ImageType>::
-GenerateData()
-{
- ImagePointer temp = dynamic_cast<ImageType*>(itk::ProcessObject::GetInput(0));
- m_Object = dynamic_cast<ImageType*>(itk::ProcessObject::GetInput(1));
- ImagePointer temp2 = dynamic_cast<ImageType*>(itk::ProcessObject::GetInput(2));
-
- // Remove object from support (keep initial image)
- m_Support = clitk::Clone<ImageType>(temp);
- clitk::AndNot<ImageType>(m_Support, m_Object, GetBackgroundValue());
-
- // Remove object from target. Important because sometimes, there is
- // overlap between target and object.
- m_Target = clitk::Clone<ImageType>(temp2);
- clitk::AndNot<ImageType>(m_Target, m_Object, GetBackgroundValue());
-
- // Define filter to compute statics on mask image
- typedef itk::LabelStatisticsImageFilter<ImageType, ImageType> StatFilterType;
- typename StatFilterType::Pointer statFilter = StatFilterType::New();
-
- // Compute the initial support size
- statFilter->SetInput(m_Support);
- statFilter->SetLabelInput(m_Support);
- statFilter->Update();
- SetSupportSize(statFilter->GetCount(GetForegroundValue()));
- // DD(GetSupportSize());
-
- // Compute the initial target size
- ImagePointer s = clitk::ResizeImageLike<ImageType>(m_Support, m_Target, GetBackgroundValue());
- statFilter->SetInput(s);
- statFilter->SetLabelInput(m_Target);
- statFilter->Update();
- SetTargetSize(statFilter->GetCount(GetForegroundValue()));
- // DD(GetTargetSize());
-
- //
- int bins = GetNumberOfBins();
- double tolerance = GetAreaLossTolerance();
-
- // Compute Fuzzy map
- double angle = GetDirection().angle1;
- typename FloatImageType::Pointer map = ComputeFuzzyMap(m_Object, m_Target, m_Support, angle);
- writeImage<FloatImageType>(map, "fuzzy_"+toString(clitk::rad2deg(angle))+".mha");
-
- // Compute the optimal thresholds (direct and inverse)
- double mThreshold=0.0;
- double mReverseThreshold=1.0;
- ComputeOptimalThresholds(map, m_Target, bins, tolerance, mThreshold, mReverseThreshold);
-
- // DD(mThreshold);
- // DD(mReverseThreshold);
-
- // Use the threshold to compute new support
- int s1 = GetSupportSize();
- if (mThreshold > 0.0) {
- ImagePointer support1 =
- clitk::SliceBySliceRelativePosition<ImageType>(m_Support, m_Object, 2,
- mThreshold,
- angle,false, // inverseFlag
- false, // uniqueConnectedComponent
- -1, true,
- false);//singleObjectCCL
- // Compute the new support size
- statFilter->SetInput(support1);
- statFilter->SetLabelInput(support1);
- statFilter->Update();
- s1 = statFilter->GetCount(GetForegroundValue());
- }
-
- int s2 = GetSupportSize();
- if (mReverseThreshold < 1.0) {
- ImagePointer support2 =
- clitk::SliceBySliceRelativePosition<ImageType>(m_Support, m_Object, 2,
- mReverseThreshold,
- angle,true,// inverseFlag
- false, // uniqueConnectedComponent
- -1, true,
- false); //singleObjectCCL
- // Compute the new support size
- statFilter = StatFilterType::New();
- statFilter->SetInput(support2);
- statFilter->SetLabelInput(support2);
- statFilter->Update();
- s2 = statFilter->GetCount(GetForegroundValue());
- }
-
- // Check threshold, if we gain nothing, we force to max/min thresholds
- // DD(GetSupportSize());
- // DD(s1);
- // DD(s2);
- if (s1 >= GetSupportSize()) mThreshold = 0.0;
- if (s2 >= GetSupportSize()) mReverseThreshold = 1.0;
-
- // Set results values
- m_Info.threshold = mThreshold;
- m_Info.sizeAfterThreshold = s1;
- m_Info.sizeBeforeThreshold = GetSupportSize();
- m_Info.sizeReference = GetTargetSize();
- m_InfoReverse.threshold = mReverseThreshold;
- m_InfoReverse.sizeAfterThreshold = s2;
- m_InfoReverse.sizeBeforeThreshold = GetSupportSize();
- m_InfoReverse.sizeReference = GetTargetSize();
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template <class ImageType>
-typename clitk::RelativePositionAnalyzerFilter<ImageType>::FloatImageType::Pointer
-clitk::RelativePositionAnalyzerFilter<ImageType>::
-ComputeFuzzyMap(ImageType * object, ImageType * target, ImageType * support, double angle)
-{
- typedef clitk::SliceBySliceRelativePositionFilter<ImageType> SliceRelPosFilterType;
- typedef typename SliceRelPosFilterType::FloatImageType FloatImageType;
- typename SliceRelPosFilterType::Pointer sliceRelPosFilter = SliceRelPosFilterType::New();
- sliceRelPosFilter->VerboseStepFlagOff();
- sliceRelPosFilter->WriteStepFlagOff();
- sliceRelPosFilter->SetInput(support);
- sliceRelPosFilter->SetInputObject(object);
- sliceRelPosFilter->SetDirection(2);
- sliceRelPosFilter->SetIntermediateSpacingFlag(false);
- //sliceRelPosFilter->AddOrientationTypeString(orientation);
- sliceRelPosFilter->AddAnglesInRad(angle, 0.0);
- sliceRelPosFilter->FuzzyMapOnlyFlagOn(); // do not threshold, only compute the fuzzy map
- // sliceRelPosFilter->PrintOptions();
- sliceRelPosFilter->Update();
- typename FloatImageType::Pointer map = sliceRelPosFilter->GetFuzzyMap();
- writeImage<FloatImageType>(map, "fuzzy_0_"+toString(clitk::rad2deg(angle))+".mha");
-
- // Resize object like map to allow SetBackground
- ImagePointer temp = clitk::ResizeImageLike<ImageType>(object, map, GetBackgroundValue());
- // writeImage<FloatImageType>(map, "fuzzy_1_"+toString(clitk::rad2deg(angle))+".mha");
-
- // Remove initial object from the fuzzy map
- map = clitk::SetBackground<FloatImageType, ImageType>(map, temp, GetForegroundValue(), 0.0, true);
- writeImage<FloatImageType>(map, "fuzzy_2_"+toString(clitk::rad2deg(angle))+".mha");
-
- // Resize the fuzzy map like the target, put 2.0 when outside
- map = clitk::ResizeImageLike<FloatImageType>(map, target, 2.0); // Put 2.0 when out of initial map
- writeImage<FloatImageType>(map, "fuzzy_3_"+toString(clitk::rad2deg(angle))+".mha");
-
- // end
- return map;
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template <class ImageType>
-void
-clitk::RelativePositionAnalyzerFilter<ImageType>::
-ComputeOptimalThresholds(FloatImageType * map, ImageType * target, int bins, double tolerance,
- double & threshold, double & reverseThreshold)
-{
- // Get the histogram of fuzzy values inside the target image
- typedef itk::LabelStatisticsImageFilter<FloatImageType, ImageType> FloatStatFilterType;
- typename FloatStatFilterType::Pointer f = FloatStatFilterType::New();
- f->SetInput(map);
- f->SetLabelInput(target);
- f->UseHistogramsOn();
- f->SetHistogramParameters(bins, 0.0-(1.0/bins), 1.0+(1.0/bins));
- f->Update();
- int count = f->GetCount(GetForegroundValue());
- // DD(count);
- typename FloatStatFilterType::HistogramPointer h = f->GetHistogram(GetForegroundValue());
-
- // Debug : dump histogram
- static int i=0;
- std::ofstream histogramFile(std::string("fuzzy_histo_"+toString(i)+".txt").c_str());
- for(int j=0; j<bins; j++) {
- histogramFile << h->GetMeasurement(j,0)
- << "\t" << h->GetFrequency(j)
- << "\t" << (double)h->GetFrequency(j)/(double)count << std::endl;
- }
- histogramFile.close();
- std::ofstream histogramFile2(std::string("fuzzy_histo_R_"+toString(i)+".txt").c_str());
- for(int j=bins-1; j>=0; j--) {
- histogramFile2 << h->GetMeasurement(j,0)
- << "\t" << h->GetFrequency(j)
- << "\t" << (double)h->GetFrequency(j)/(double)count << std::endl;
- }
- histogramFile2.close();
- i++;
-
- // Analyze the histogram (direct)
- double sum = 0.0;
- bool found = false;
- threshold = 0.0;
- for(int j=0; j<bins-1; j++) {
- sum += ((double)h->GetFrequency(j)/(double)count);
- // DD(j);
- // DD(sum);
- // DD(threshold);
- // DD(h->GetBinMin(0,j));
- // DD(h->GetBinMax(0,j));
- if ((!found) && (sum > tolerance)) {
- // We consider as threshold the laste before current, because
- if (j==0)
- threshold = h->GetBinMin(0,j);
- else threshold = h->GetBinMin(0,j-1); // FIXME ? the last before reaching the threshold
- // DD(threshold);
- found = true;
- j = bins;
- }
- }
-
- // Analyze the histogram (reverse)
- sum = 0.0;
- found = false;
- reverseThreshold = 1.0;
- for(int j=bins-1; j>0; j--) {
- sum += ((double)h->GetFrequency(j)/(double)count);
- // DD(j);
- // DD(sum);
- // DD(reverseThreshold);
- // DD(h->GetBinMin(0,j));
- // DD(h->GetBinMax(0,j));
- if ((!found) && (sum > tolerance)) {
- if (j==bins-1)
- reverseThreshold = h->GetBinMax(0,j);
- else reverseThreshold = h->GetBinMax(0,j-1);// FIXME ? the last before reaching the threshold
- // DD(reverseThreshold);
- found = true;
- j = -1;
- }
- }
-
-}
-//--------------------------------------------------------------------
-
+++ /dev/null
-/*=========================================================================
- Program: vv http://www.creatis.insa-lyon.fr/rio/vv
-
- Authors belong to:
- - University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://www.centreleonberard.fr
- - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the copyright notices for more information.
-
- It is distributed under dual licence
-
- - BSD See included LICENSE.txt file
- - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
- ===========================================================================**/
-
-#ifndef CLITKRELATIVEPOSITIONDATABASE_CXX
-#define CLITKRELATIVEPOSITIONDATABASE_CXX
-
-// clitk
-#include "clitkRelativePositionDataBase.h"
-
-namespace clitk {
-
- //--------------------------------------------------------------------
- void RelativePositionDataBase::ReadIndex(std::istream & is, IndexType & index)
- {
- is >> index.patient;
- is >> index.station;
- is >> index.object;
- is >> index.direction.angle1;
- index.direction.angle1 = clitk::deg2rad(index.direction.angle1);
- is >> index.direction.angle2;
- index.direction.angle2 = clitk::deg2rad(index.direction.angle2);
- std::string s;
- is >> s;
- if (s=="true") index.direction.notFlag = true;
- else index.direction.notFlag = false;
- }
- //--------------------------------------------------------------------
-
-
- //--------------------------------------------------------------------
- void RelativePositionDataBase::ReadInformation(std::istream & is, RelativePositionInformationType & v)
- {
- is >> v.threshold;
- is >> v.sizeBeforeThreshold;
- is >> v.sizeAfterThreshold;
- is >> v.sizeReference;
- }
- //--------------------------------------------------------------------
-
- //--------------------------------------------------------------------
- void RelativePositionDataBase::Read(const std::string & filename)
- {
- std::ifstream is;
- openFileForReading(is, filename);
-
- std::string s;
- IndexType index;
- RelativePositionInformationType v;
- while (is) {
- skipComment(is); /* FIXME Read Index etc */
- ReadIndex(is, index);
- ReadInformation(is, v);
-
- if (is) {// FIXME INSERT
- // Set in station
- if (m_DB.find(index.station) == m_DB.end()) {
- MapByObjectType s;
- m_DB[index.station] = s;
- }
- MapByObjectType & s = m_DB[index.station];
-
- // Get Direction map from Object
- if (s.find(index.object) == s.end()) {
- MapByDirectionType r;
- s[index.object] = r;
- }
- MapByDirectionType & r = s[index.object];
-
- // Get Patient map from Direction
- if (r.find(index.direction) == r.end()) {
- MapByPatientType q;
- r[index.direction] = q;
- }
- MapByPatientType & q = r[index.direction];
-
- // Set value by patient
- q[index.patient] = v;
-
- // Debug
- // index.Println();
- // GetMapByPatient(index).find(index.patient)->second.Println();
-
- } // End insertion
- } // end loop reading
- }
- //--------------------------------------------------------------------
-
-
- //--------------------------------------------------------------------
- const RelativePositionDataBase::MapByDirectionType &
- RelativePositionDataBase::GetMapByDirection(const IndexType & index) const
- {
- const MapByObjectType & a = GetMapByObject(index.station);
- if (a.find(index.object) == a.end()) {
- clitkExceptionMacro("Could not find index in DB (object= '" << index.object << "' not found).");
- }
- return a.find(index.object)->second;
- }
- //--------------------------------------------------------------------
-
-
- //--------------------------------------------------------------------
- const RelativePositionDataBase::MapByObjectType &
- RelativePositionDataBase::GetMapByObject(const std::string & station) const
- {
- if (m_DB.find(station) == m_DB.end()) {
- clitkExceptionMacro("Could not find index in DB (station= '" << station << "' not found).");
- }
- return m_DB.find(station)->second;
- }
- //--------------------------------------------------------------------
-
-
- //--------------------------------------------------------------------
- const RelativePositionDataBase::MapByPatientType &
- RelativePositionDataBase::GetMapByPatient(const IndexType & index) const
- {
- const MapByDirectionType & a = GetMapByDirection(index);
- if (a.find(index.direction) == a.end()) {
- std::ostringstream s;
- index.direction.Print(s);
- clitkExceptionMacro("Could not find index in DB (direction= '" << s.str() << "' not found).");
- }
- return a.find(index.direction)->second;
- }
- //--------------------------------------------------------------------
-
-
- //--------------------------------------------------------------------
- const RelativePositionInformationType &
- RelativePositionDataBase::GetInformation(const IndexType & index) const
- {
- const RelativePositionDataBase::MapByPatientType & a = GetMapByPatient(index);
- if (a.find(index.patient) == a.end()) {
- clitkExceptionMacro("Could not find index in DB (patient= '" << index.patient << "' not found).");
- }
- return a.find(index.patient)->second;
- }
- //--------------------------------------------------------------------
-
-
- //--------------------------------------------------------------------
- int RelativePositionDataBase::GetNumberOfPatient(const IndexType & index) const
- {
- const MapByPatientType & o = GetMapByPatient(index);
- return o.size();
- }
- //--------------------------------------------------------------------
-
-
- //--------------------------------------------------------------------
- std::vector<std::string> & RelativePositionDataBase::GetListOfPatients(const IndexType & index) const
- {
- const MapByPatientType & o = GetMapByPatient(index);
- std::vector<std::string> * v = new std::vector<std::string>;
- MapToVecFirst(o, *v);
- return *v;
- }
- //--------------------------------------------------------------------
-
-
- //--------------------------------------------------------------------
- double RelativePositionDataBase::GetAreaGain(const IndexType & index) const
- {
- // FIXME change name
- const RelativePositionInformationType & v = GetInformation(index);
- return v.sizeAfterThreshold/v.sizeBeforeThreshold;
- }
- //--------------------------------------------------------------------
-
-
- //--------------------------------------------------------------------
- double RelativePositionDataBase::GetThreshold(const IndexType & index) const
- {
- const RelativePositionInformationType & v = GetInformation(index);
- return v.threshold;
- }
- //--------------------------------------------------------------------
-
-
- //--------------------------------------------------------------------
- void
- RelativePositionDataBase::GetListOfObjects(const std::string & station, std::vector<std::string> & objects) const
- {
- const MapByObjectType & a = GetMapByObject(station);
- MapToVecFirst(a, objects);
- }
- //--------------------------------------------------------------------
-
-
- //--------------------------------------------------------------------
- void
- RelativePositionDataBase::GetListOfDirections(const std::string & station,
- const std::string & object,
- std::vector<RelativePositionDirectionType> & directions) const
- {
- IndexType i;
- i.station = station;
- i.object = object;
- const MapByDirectionType & n = GetMapByDirection(i);
- MapToVecFirst(n, directions);
- }
- //--------------------------------------------------------------------
-
-
- //--------------------------------------------------------------------
- bool RelativePositionDataBase::CheckIndex(const IndexType & index) const
- {
- try {
- /*const RelativePositionInformationType & m = */ GetInformation(index);
- } catch (clitk::ExceptionObject e) {
- // std::cout << e.what() << std::endl;
- return false;
- }
- return true;
- }
- //--------------------------------------------------------------------
-
- //--------------------------------------------------------------------
- std::ostream& operator<<(std::ostream & os, const clitk::RelativePositionInformationType & rp)
- {
- rp.Print(os);
- return os;
- }
- //--------------------------------------------------------------------
-
-} // end namespace clitk
-//--------------------------------------------------------------------
-
-#endif
+++ /dev/null
-/*=========================================================================
- Program: vv http://www.creatis.insa-lyon.fr/rio/vv
-
- Authors belong to:
- - University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://www.centreleonberard.fr
- - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the copyright notices for more information.
-
- It is distributed under dual licence
-
- - BSD See included LICENSE.txt file
- - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
- ===========================================================================**/
-
-#ifndef CLITKRELATIVEPOSITIONDATABASE_H
-#define CLITKRELATIVEPOSITIONDATABASE_H
-
-// clitk
-#include "clitkCommon.h"
-
-namespace clitk {
-
- //--------------------------------------------------------------------
- /*
- FIXME
- */
- //--------------------------------------------------------------------
-
-
- //--------------------------------------------------------------------
- class RelativePositionDirectionType {
- public:
- double angle1;
- double angle2;
- bool notFlag;
-
- void Print(std::ostream & os = std::cout) const {
- os << clitk::rad2deg(angle1) << " " << clitk::rad2deg(angle2) << " ";
- if (notFlag) os << "true";
- else os << "false";
- os << " ";
- }
-
- void PrintOptions(std::ostream & os = std::cout) const {
- os << "angle1 = " << clitk::rad2deg(angle1) << std::endl
- << "angle2 = " << clitk::rad2deg(angle2) << std::endl;
- if (notFlag) os << "inverse" << std::endl;
- }
-
- void Println(std::ostream & os = std::cout) const {
- Print(os);
- os << std::endl;
- }
-
- bool operator< (const RelativePositionDirectionType &compare) const
- {
- if (angle1 < compare.angle1) return true;
- if (angle1 > compare.angle1) return false;
-
- if (angle2 < compare.angle2) return true;
- if (angle2 > compare.angle2) return false;
-
- if (notFlag == true) {
- if (compare.notFlag == false) return true;
- else return false;
- }
- return false;
- }
- };
- //--------------------------------------------------------------------
-
-
- //--------------------------------------------------------------------
- class RelativePositionDataBaseIndexType {
- public:
- std::string patient;
- std::string station;
- std::string object;
- RelativePositionDirectionType direction;
- void Print(std::ostream & os = std::cout) const {
- os << patient << " " << station << " " << object << " ";
- direction.Print(os);
- }
- void Println(std::ostream & os = std::cout) const {
- Print(os);
- os << std::endl;
- }
- };
- //--------------------------------------------------------------------
-
-
- //--------------------------------------------------------------------
- class RelativePositionInformationType {
- public:
- double threshold;
- int sizeBeforeThreshold;
- int sizeAfterThreshold;
- int sizeReference;
- void Print(std::ostream & os = std::cout) const {
- os << threshold << " " << sizeBeforeThreshold << " "
- << sizeAfterThreshold << " " << sizeReference;
- }
- void Println(std::ostream & os = std::cout) const {
- Print(os);
- os << std::endl;
- }
- };
- std::ostream& operator<<(std::ostream & os, const clitk::RelativePositionInformationType & rp);
- //--------------------------------------------------------------------
-
-
- //--------------------------------------------------------------------
- class RelativePositionDataBase {
-
- public:
- RelativePositionDataBase() {}
- ~RelativePositionDataBase() {}
-
- typedef RelativePositionDataBaseIndexType IndexType;
-
- void Read(const std::string & filename);
- double GetAreaGain(const IndexType & index) const;
- double GetThreshold(const IndexType & index) const;
- int GetNumberOfPatient(const IndexType & index) const;
- std::vector<std::string> & GetListOfPatients(const IndexType & index) const;
- void GetListOfObjects(const std::string & station, std::vector<std::string> & objects) const;
- void GetListOfDirections(const std::string & station,
- const std::string & object,
- std::vector<RelativePositionDirectionType> & directions) const;
- bool CheckIndex(const IndexType & index) const;
-
- protected:
- typedef std::map<std::string, RelativePositionInformationType> MapByPatientType;
- typedef std::map<RelativePositionDirectionType, MapByPatientType> MapByDirectionType;
- typedef std::map<std::string, MapByDirectionType> MapByObjectType;
- typedef std::map<std::string, MapByObjectType> MapByStationType;
- MapByStationType m_DB;
-
- void ReadIndex(std::istream & is, IndexType & index);
- void ReadInformation(std::istream & is, RelativePositionInformationType & v);
-
- const MapByDirectionType & GetMapByDirection(const IndexType & index) const;
- const MapByPatientType & GetMapByPatient(const IndexType & index) const;
- const RelativePositionInformationType & GetInformation(const IndexType & index) const;
- const MapByObjectType & GetMapByObject(const std::string & station) const;
-
- }; // end class
- //--------------------------------------------------------------------
-
-} // end namespace clitk
-//--------------------------------------------------------------------
-
-#endif
+++ /dev/null
-/*=========================================================================
- Program: vv http://www.creatis.insa-lyon.fr/rio/vv
-
- Authors belong to:
- - University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://www.centreleonberard.fr
- - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the copyright notices for more information.
-
- It is distributed under dual licence
-
- - BSD See included LICENSE.txt file
- - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
- ===========================================================================**/
-
-#ifndef CLITKRELATIVEPOSITIONANALYZERFILTER_H
-#define CLITKRELATIVEPOSITIONANALYZERFILTER_H
-
-// clitk
-#include "clitkFilterWithAnatomicalFeatureDatabaseManagement.h"
-#include "clitkFilterBase.h"
-#include "clitkRelativePositionDataBase.h"
-
-namespace clitk {
-
- //--------------------------------------------------------------------
- /*
- Load a database of relative positions. Analyze it and provide
- common relative position for each patient.
- */
- //--------------------------------------------------------------------
-
- class RelativePositionDataBaseAnalyzerFilter:
- public virtual clitk::FilterBase,
- public clitk::FilterWithAnatomicalFeatureDatabaseManagement
- {
-
- public:
- RelativePositionDataBaseAnalyzerFilter();
- virtual ~RelativePositionDataBaseAnalyzerFilter() {}
-
- // Input
- itkGetConstMacro(DatabaseFilename, std::string);
- itkSetMacro(DatabaseFilename, std::string);
- itkGetConstMacro(StationName, std::string);
- itkSetMacro(StationName, std::string);
- itkGetConstMacro(ObjectName, std::string);
- itkSetMacro(ObjectName, std::string);
- itkGetConstMacro(OutputFilename, std::string);
- itkSetMacro(OutputFilename, std::string);
-
- // For debug
- void PrintOptions();
-
- // Go !
- virtual void Update();
-
- protected:
- std::string m_DatabaseFilename;
- std::string m_StationName;
- std::string m_ObjectName;
- std::string m_OutputFilename;
- clitk::RelativePositionDataBase db;
-
- bool ComputeOptimalThreshold(RelativePositionDataBaseIndexType & index, double & threshold);
-
- }; // end class
- //--------------------------------------------------------------------
-
-} // end namespace clitk
-//--------------------------------------------------------------------
-
-#include "clitkRelativePositionDataBaseAnalyzerFilter.txx"
-
-#endif
+++ /dev/null
-/*=========================================================================
- Program: vv http://www.creatis.insa-lyon.fr/rio/vv
-
- Authors belong to:
- - University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://www.centreleonberard.fr
- - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the copyright notices for more information.
-
- It is distributed under dual licence
-
- - BSD See included LICENSE.txt file
- - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
- ===========================================================================**/
-
-//--------------------------------------------------------------------
-clitk::RelativePositionDataBaseAnalyzerFilter::
-RelativePositionDataBaseAnalyzerFilter():
- clitk::FilterBase(),
- clitk::FilterWithAnatomicalFeatureDatabaseManagement()
-{
- VerboseFlagOff();
- SetDatabaseFilename("default.dbrp");
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-void
-clitk::RelativePositionDataBaseAnalyzerFilter::
-PrintOptions()
-{
- DD("TODO");
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-void
-clitk::RelativePositionDataBaseAnalyzerFilter::
-Update()
-{
- // Load DB of relative position
- db.Read(GetDatabaseFilename());
-
- // Get list of objects, list of orientation
- std::vector<std::string> m_ListOfObjects;
- db.GetListOfObjects(GetStationName(), m_ListOfObjects);
-
- // Set initial index in the DB
- clitk::RelativePositionDataBase::IndexType index;
- index.station = GetStationName();
-
- // Loop over objects
- std::vector<double> m_ListOfThresholds;
- for(unsigned int i=0; i<m_ListOfObjects.size(); i++) {
- // DD(i);
- // DD(m_ListOfObjects[i]);
- // Set current index
- index.object = m_ListOfObjects[i];
- // Get the list of direction
- std::vector<clitk::RelativePositionDirectionType> m_ListOfDirections;
- db.GetListOfDirections(GetStationName(), index.object, m_ListOfDirections);
-
- // Loop over direction
- for(unsigned int j=0; j<m_ListOfDirections.size(); j++) {
- // DD(j);
- // m_ListOfDirections[j].Println();
- // Set current index
- index.direction = m_ListOfDirections[j];
- // Compute the best RelPos parameters
- double threshold;
- bool ok = ComputeOptimalThreshold(index, threshold);
- m_ListOfThresholds.push_back(threshold);
-
- // Print debug FIXME
- if (ok) {
- /*std::cout << m_ListOfObjects[i] << " ";
- m_ListOfDirections[j].Print();
- std::cout << " " << threshold << " " << ok << std::endl;
- */
- std::cout << "# -----------------------" << std::endl
- << "object = " << m_ListOfObjects[i] << std::endl;
- m_ListOfDirections[j].PrintOptions();
- std::cout << "threshold = " << threshold << std::endl
- << "sliceBySlice" << std::endl << std::endl; // FIXME spacing ?
- }
- }
- }
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-bool
-clitk::RelativePositionDataBaseAnalyzerFilter::
-ComputeOptimalThreshold(RelativePositionDataBaseIndexType & index, double & threshold)
-{
- // Get list of patient
- std::vector<std::string> & ListOfPatients = db.GetListOfPatients(index);
- // DD(ListOfPatients.size());
- // index.direction.Println();
-
- // For a given station, object, direction
- bool stop=false;
- unsigned int i=0;
- if (index.direction.notFlag) threshold = 0.0;
- else threshold = 1.0;
- while (!stop && (i<ListOfPatients.size())) {
- index.patient = ListOfPatients[i];
- // Check index
- if (!db.CheckIndex(index)) {
- std::cout << "Warning index does not exist in the DB. index = ";
- index.Println(std::cout);
- }
- else {
- if (index.direction.notFlag) threshold = std::max(db.GetThreshold(index), threshold);
- else threshold = std::min(db.GetThreshold(index), threshold);
- }
- ++i;
- } // end while
-
- if (index.direction.notFlag) {
- if (threshold >=1) return false; // not useful
- }
- else {
- if (threshold <=0) return false; // not useful
- }
- return true;
-}
-//--------------------------------------------------------------------
+++ /dev/null
-/*=========================================================================
- Program: vv http://www.creatis.insa-lyon.fr/rio/vv
-
- Authors belong to:
- - University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://www.centreleonberard.fr
- - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the copyright notices for more information.
-
- It is distributed under dual licence
-
- - BSD See included LICENSE.txt file
- - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
- ===========================================================================**/
-
-#ifndef CLITKRelativePositionDataBaseBuilderFILTER_H
-#define CLITKRelativePositionDataBaseBuilderFILTER_H
-
-// clitk
-#include "clitkFilterWithAnatomicalFeatureDatabaseManagement.h"
-#include "clitkFilterBase.h"
-#include "clitkRelativePositionAnalyzerFilter.h"
-#include "clitkRelativePositionDataBase.h"
-
-// itk
-#include <itkImageToImageFilter.h>
-
-namespace clitk {
-
- //--------------------------------------------------------------------
- /*
- Analyze the relative position of a Target (mask image) according
- to some Object, in a given Support. Indicate the main important
- position of this Target according the Object.
- */
- //--------------------------------------------------------------------
-
- template <class ImageType>
- class RelativePositionDataBaseBuilderFilter:
- public virtual FilterBase,
- public clitk::FilterWithAnatomicalFeatureDatabaseManagement,
- public itk::ImageToImageFilter<ImageType, ImageType>
- {
-
- public:
- /** Standard class typedefs. */
- typedef itk::ImageToImageFilter<ImageType, ImageType> Superclass;
- typedef RelativePositionDataBaseBuilderFilter<ImageType> Self;
- typedef itk::SmartPointer<Self> Pointer;
- typedef itk::SmartPointer<const Self> ConstPointer;
-
- /** Method for creation through the object factory. */
- itkNewMacro(Self);
-
- /** Run-time type information (and related methods). */
- itkTypeMacro(RelativePositionDataBaseBuilderFilter, ImageToImageFilter);
-
- /** Some convenient typedefs. */
- typedef typename ImageType::ConstPointer ImageConstPointer;
- typedef typename ImageType::Pointer ImagePointer;
- typedef typename ImageType::RegionType RegionType;
- typedef typename ImageType::PixelType PixelType;
- typedef typename ImageType::SpacingType SpacingType;
- typedef typename ImageType::SizeType SizeType;
- typedef typename ImageType::IndexType IndexType;
- typedef typename ImageType::PointType PointType;
-
- /** ImageDimension constants */
- itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
- FILTERBASE_INIT;
- typedef itk::Image<float, ImageDimension> FloatImageType;
-
- // Inputs
- itkGetConstMacro(SupportName, std::string);
- itkSetMacro(SupportName, std::string);
-
- itkGetConstMacro(TargetName, std::string);
- itkSetMacro(TargetName, std::string);
-
- void AddObjectName(std::string s) { m_ObjectNames.push_back(s); }
- std::string & GetObjectName(int i) { return m_ObjectNames[i]; }
- int GetNumberOfObjects() { return m_ObjectNames.size(); }
-
- // Options
- itkGetConstMacro(BackgroundValue, PixelType);
- itkSetMacro(BackgroundValue, PixelType);
-
- itkGetConstMacro(ForegroundValue, PixelType);
- itkSetMacro(ForegroundValue, PixelType);
-
- itkGetConstMacro(NumberOfBins, int);
- itkSetMacro(NumberOfBins, int);
-
- itkGetConstMacro(NumberOfAngles, int);
- itkSetMacro(NumberOfAngles, int);
-
- itkGetConstMacro(AreaLossTolerance, double);
- itkSetMacro(AreaLossTolerance, double);
-
- // For debug
- void PrintOptions();
-
- // I dont want to verify inputs information
- virtual void VerifyInputInformation() { }
-
- protected:
- RelativePositionDataBaseBuilderFilter();
- virtual ~RelativePositionDataBaseBuilderFilter() {}
-
- PixelType m_BackgroundValue;
- PixelType m_ForegroundValue;
-
- ImagePointer m_Support;
- ImagePointer m_Object;
- ImagePointer m_Target;
-
- std::string m_SupportName;
- std::string m_TargetName;
- std::vector<std::string> m_ObjectNames;
-
- int m_NumberOfAngles;
- std::vector<double> m_ListOfAngles;
- std::vector<clitk::RelativePositionDirectionType> m_ListOfDirections;
-
- int m_NumberOfBins;
- double m_AreaLossTolerance;
-
- virtual void GenerateOutputInformation();
- virtual void GenerateInputRequestedRegion();
- virtual void GenerateData();
-
- typename FloatImageType::Pointer
- ComputeFuzzyMap(ImageType * object, ImageType * target, double angle);
-
- void
- ComputeOptimalThresholds(FloatImageType * map, ImageType * target, int bins, double tolerance,
- double & threshold, double & reverseThreshold);
- private:
- RelativePositionDataBaseBuilderFilter(const Self&); //purposely not implemented
- void operator=(const Self&); //purposely not implemented
-
- }; // end class
- //--------------------------------------------------------------------
-
-} // end namespace clitk
-//--------------------------------------------------------------------
-
-#include "clitkRelativePositionDataBaseBuilderFilter.txx"
-
-#endif
+++ /dev/null
-/*=========================================================================
- Program: vv http://www.creatis.insa-lyon.fr/rio/vv
-
- Authors belong to:
- - University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://www.centreleonberard.fr
- - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the copyright notices for more information.
-
- It is distributed under dual licence
-
- - BSD See included LICENSE.txt file
- - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
- ===========================================================================**/
-
-//--------------------------------------------------------------------
-template <class ImageType>
-clitk::RelativePositionDataBaseBuilderFilter<ImageType>::
-RelativePositionDataBaseBuilderFilter():
- clitk::FilterBase(),
- clitk::FilterWithAnatomicalFeatureDatabaseManagement(),
- itk::ImageToImageFilter<ImageType, ImageType>()
-{
- this->SetNumberOfRequiredInputs(0); // support
- VerboseFlagOff();
- SetBackgroundValue(0);
- SetForegroundValue(1);
- SetNumberOfBins(100);
- SetNumberOfAngles(4);
- SetAreaLossTolerance(0.01);
- m_ListOfAngles.clear();
- // SetSupportSize(0);
- // SetTargetSize(0);
- // SetSizeWithThreshold(0);
- // SetSizeWithReverseThreshold(0);
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template <class ImageType>
-void
-clitk::RelativePositionDataBaseBuilderFilter<ImageType>::
-PrintOptions()
-{
- DD("TODO");
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template <class ImageType>
-void
-clitk::RelativePositionDataBaseBuilderFilter<ImageType>::
-GenerateOutputInformation()
-{
- // ImagePointer input = dynamic_cast<ImageType*>(itk::ProcessObject::GetInput(0));
- // ImagePointer outputImage = this->GetOutput(0);
- // outputImage->SetRegions(outputImage->GetLargestPossibleRegion());
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template <class ImageType>
-void
-clitk::RelativePositionDataBaseBuilderFilter<ImageType>::
-GenerateInputRequestedRegion()
-{
- // Call default
- // itk::ImageToImageFilter<ImageType, ImageType>::GenerateInputRequestedRegion();
- // // Get input pointers and set requested region to common region
- // ImagePointer input1 = dynamic_cast<ImageType*>(itk::ProcessObject::GetInput(0));
- // input1->SetRequestedRegion(input1->GetLargestPossibleRegion());
-}
-//--------------------------------------------------------------------
-
-//--------------------------------------------------------------------
-template <class ImageType>
-void
-clitk::RelativePositionDataBaseBuilderFilter<ImageType>::
-GenerateData()
-{
- // Load database of anatomical elements
- this->LoadAFDB();
-
- // Get some information
- std::string patient = this->GetAFDB()->GetTagValue("PatientID");
-
- // Get input pointers
- m_Support = this->GetAFDB()->template GetImage <ImageType>(GetSupportName());
- m_Target = this->GetAFDB()->template GetImage <ImageType>(GetTargetName());
-
- // Build the list of tested directions
- m_ListOfAngles.clear();
- for(int i=0; i<GetNumberOfAngles(); i++) {
- double a = i*360.0/GetNumberOfAngles();
- if (a>180) a = 180-a;
- m_ListOfAngles.push_back(clitk::deg2rad(a));
- RelativePositionDirectionType r;
- r.angle1 = clitk::deg2rad(a);
- r.angle2 = 0;
- r.notFlag = false;
- m_ListOfDirections.push_back(r); // only one direction
- }
-
-
- // Perform the RelativePositionAnalyzerFilter for each objects
- typedef typename clitk::RelativePositionAnalyzerFilter<ImageType> FilterType;
- for (int i=0; i<GetNumberOfObjects(); i++) {
- m_Object = this->GetAFDB()->template GetImage <ImageType>(GetObjectName(i));
-
- for (unsigned int j=0; j<m_ListOfDirections.size(); j++) {
- clitk::RelativePositionDirectionType direction = m_ListOfDirections[j];
-
- // Create the filter
- typename FilterType::Pointer filter = FilterType::New();
- filter->SetInputSupport(m_Support);
- filter->SetInputTarget(m_Target);
- filter->SetInputObject(m_Object); // FIXME do AndNot before + only compute supportSize once.
- filter->SetNumberOfBins(GetNumberOfBins());
- filter->SetAreaLossTolerance(GetAreaLossTolerance());
- filter->SetDirection(direction);
- filter->Update();
-
- // Results
- std::ostringstream s;
- s << patient << " "
- << GetSupportName() << " "
- // << GetTargetName() << " " // No need
- << GetObjectName(i) <<" ";
- // Normal
- // if (filter->GetInfo().sizeAfterThreshold != filter->GetInfo().sizeBeforeThreshold) {
- std::ostringstream os;
- os << s.str();
- direction.notFlag = false;
- direction.Print(os);
- filter->GetInfo().Print(os);
- std::cout << os.str() << std::endl;
- // }
- // Inverse
- // if (filter->GetInfoReverse().sizeAfterThreshold != filter->GetInfoReverse().sizeBeforeThreshold) {
- std::ostringstream oos;
- oos << s.str();
- direction.notFlag = true;
- direction.Print(oos);
- filter->GetInfoReverse().Print(oos);
- std::cout << oos.str() << std::endl;
- // }
- } // end direction
-
- } // end object
-}
-//--------------------------------------------------------------------
-
-