freImageAdaptationInverter.cxx

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   F.R.E.E. - flexible registration evaluation engine
00004   Version:   v.1.0.0
00005   Date:      $Date: 2006/09/01 12:00:00 $
00006   Module:    $RCSfile: freImageAdaptationInverter.h,v $
00007   Language:  C++
00008 
00009 
00010 
00011   Copyright (c) 2007 Ralf o Floca (Department of Medical Informatics,
00012   Institute for Medical Biometry and Informatics, University of Heidelberg,
00013   Germany). All rights reserved.
00014   See FREECopyright.txt or http://www.mi.med.uni-hd.de/free/copyright.htm
00015   for details.
00016 
00017      This software is distributed WITHOUT ANY WARRANTY; without even 
00018      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00019      PURPOSE.  See the above copyright notices for more information.
00020 
00021 =========================================================================*/
00022 #include "freImageAdaptationInverter.h"
00023 #include "freAdaptation.h"
00024 
00025 namespace FREE
00026 {
00027 
00031 
00032 
00033 Adaptation::Adaptation::Pointer
00034 ImageAdaptationInverter::
00035 InvertAdaptation (const Adaptation::Adaptation& adaptation)
00036 {
00037   Adaptation::Adaptation::Pointer smpAdaptation = Adaptation::Adaptation::New();
00038   smpAdaptation->operator=(adaptation);
00039 
00040         //Search for the fixed and moving image container
00041         Adaptation::AdaptationComponent* pMovingContainer = NULL;
00042         Adaptation::AdaptationComponent* pFixedContainer = NULL;
00043 
00044         for (Adaptation::Adaptation::ElementsCountType iIndex = 0; iIndex<smpAdaptation->Size(); iIndex++)
00045         {
00046                 Adaptation::AdaptationComponent* pComp = smpAdaptation->GetElement(iIndex);
00047     //TODO
00048                 //if (pComp->GetComponentType()==ComponentSetup::CTMediaContainer)
00049                 //{
00050                 //      if (pComp->GetComponentPath()==cIDPMediaMoving)
00051                 //      {
00052                 //              pMovingContainer = pComp;
00053                 //      }
00054                 //      else if (pComp->GetComponentPath()==cIDPMediaFixed)
00055                 //      {
00056                 //              pFixedContainer = pComp;
00057                 //      }
00058                 //}
00059         }
00060 
00061         //now change both container
00062         if (!pMovingContainer) throwStaticExceptionMacro("Error. No moving media container found.");
00063         if (!pFixedContainer) throwStaticExceptionMacro("Error. No fixed media container found.");
00064 
00065         pMovingContainer->SetComponentPath(cIDPMediaFixed);
00066         pFixedContainer->SetComponentPath(cIDPMediaMoving);
00067 
00068         return smpAdaptation;
00069 };
00070 
00071 ImageAdaptationInverter::
00072 ImageAdaptationInverter()
00073 {
00074 };
00075 
00076 ImageAdaptationInverter::
00077 ~ImageAdaptationInverter()
00078 {
00079 };
00080 
00081 }//End of Namespace free

Generated at Sat Oct 13 16:02:20 2007 for f.r.e.e. - Flexible Registration and Evaluation Engine by doxygen 1.5.3 written by Dimitri van Heesch, © 1997-2000