diff --git a/Code/Core/include/mapLazyFieldKernelCombinator.tpp b/Code/Core/include/mapLazyFieldKernelCombinator.tpp index ca87567..85672e5 100644 --- a/Code/Core/include/mapLazyFieldKernelCombinator.tpp +++ b/Code/Core/include/mapLazyFieldKernelCombinator.tpp @@ -1,137 +1,137 @@ // ----------------------------------------------------------------------- // MatchPoint - DKFZ translational registration framework // // Copyright (c) German Cancer Research Center (DKFZ), // Software development for Integrated Diagnostics and Therapy (SIDT). // ALL RIGHTS RESERVED. // See mapCopyright.txt or // http://www.dkfz.de/en/sidt/projects/MatchPoint/copyright.html // // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the above copyright notices for more information. // //------------------------------------------------------------------------ /*! // @file // @version $Revision$ (last changed revision) // @date $Date$ (last change date) // @author $Author$ (last changed by) // Subversion HeadURL: $HeadURL$ */ #ifndef __MAP_LAZY_FIELD_KERNEL_COMBINATOR_TPP #define __MAP_LAZY_FIELD_KERNEL_COMBINATOR_TPP #include "mapLazyFieldKernelCombinator.h" #include "mapCombinedRegistrationKernel.h" #include "mapGenericFieldGeneratingCombinationFunctor.h" #include "mapServiceException.h" namespace map { namespace core { template typename LazyFieldKernelCombinator::CombinedKernelBasePointer LazyFieldKernelCombinator:: combineKernels(const RequestType& request, const InputFieldRepresentationType* pInputFieldRepresentation, bool usePadding, const PaddingVectorType& paddingVector) const { assert(pInputFieldRepresentation); if (!pInputFieldRepresentation) { mapExceptionMacro(ServiceException, << "Error: cannot combine kernels. Reason: input field representation is NULL"); } const Kernel1Type* pKernel1 = dynamic_cast(request._spKernel1.GetPointer()); const Kernel2Type* pKernel2 = dynamic_cast(request._spKernel2.GetPointer()); if (pKernel1 == NULL) { mapExceptionMacro(ServiceException, << "Error: cannot combine kernels. Reason: cannot cast first kernel to FieldBasedRegistrationKernel: " << pKernel1); } if (pKernel2 == NULL) { mapExceptionMacro(ServiceException, << "Error: cannot combine kernels. Reason: cannot cast second kernel to FieldBasedRegistrationKernel: " << pKernel2); } typedef CombinedRegistrationKernel < VInputDimensions, VInterimDimensions, VOutputDimensions > CombinedKernelType; typename CombinedKernelType::Pointer spCombinedKernel = CombinedKernelType::New(); typedef functors::GenericFieldGeneratingCombinationFunctor < VInputDimensions, VInterimDimensions, VOutputDimensions > FunctorType; typename FunctorType::Pointer spFunctor = FunctorType::New(pKernel1, pKernel2, pInputFieldRepresentation); spFunctor->setNullPointUsage(usePadding); - spFunctor->setNullPoint(paddingVector); + spFunctor->setNullPoint(paddingVector.GetDataPointer()); spCombinedKernel->setTransformFunctor(spFunctor.GetPointer()); CombinedKernelBasePointer spResult = spCombinedKernel.GetPointer(); return spResult; } template bool LazyFieldKernelCombinator:: canHandleRequest(const RequestType& request) const { // get the two kernels from the request (which is a RegistrationCombinationRequest object) // and check if they are both FieldKernels const Kernel1Type* pKernel1 = dynamic_cast(request._spKernel1.GetPointer()); const Kernel2Type* pKernel2 = dynamic_cast(request._spKernel2.GetPointer()); return ((pKernel1 != NULL) && (pKernel2 != NULL)); } template String LazyFieldKernelCombinator:: getProviderName() const { return Self::getStaticProviderName(); } template String LazyFieldKernelCombinator:: getStaticProviderName() { OStringStream os; os << "LazyFieldKernelCombinator<" << VInputDimensions << "," << VInterimDimensions << "," << VOutputDimensions << ">"; return os.str(); } template String LazyFieldKernelCombinator:: getDescription() const { OStringStream os; os << "LazyFieldKernelCombinator, VInputDimensions: " << VInputDimensions << ", VInterimDimensions: " << VInterimDimensions << ", VOutputDimensions: " << VOutputDimensions << "."; return os.str(); } } // end namespace core } // end namespace map #endif diff --git a/Code/Core/include/mapPreCachedRegistrationKernel.tpp b/Code/Core/include/mapPreCachedRegistrationKernel.tpp index 0ba8920..053654a 100644 --- a/Code/Core/include/mapPreCachedRegistrationKernel.tpp +++ b/Code/Core/include/mapPreCachedRegistrationKernel.tpp @@ -1,173 +1,173 @@ // ----------------------------------------------------------------------- // MatchPoint - DKFZ translational registration framework // // Copyright (c) German Cancer Research Center (DKFZ), // Software development for Integrated Diagnostics and Therapy (SIDT). // ALL RIGHTS RESERVED. // See mapCopyright.txt or // http://www.dkfz.de/en/sidt/projects/MatchPoint/copyright.html // // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the above copyright notices for more information. // //------------------------------------------------------------------------ /*! // @file // @version $Revision: 1285 $ (last changed revision) // @date $Date: 2016-03-30 17:47:52 +0200 (Mi, 30 Mrz 2016) $ (last change date) // @author $Author: floca $ (last changed by) // Subversion HeadURL: $HeadURL: https://svn/sbr/Sources/SBR-Projects/MatchPoint/branches/Issue-1505/Code/Core/include/mapPreCachedRegistrationKernel.tpp $ */ #ifndef __PRE_CACHED_REGISTRATION_KERNEL_TPP #define __PRE_CACHED_REGISTRATION_KERNEL_TPP #include "mapExceptionObjectMacros.h" #include "mapGenericVectorFieldTransform.h" #include "mapFieldDecomposer.h" namespace map { namespace core { template void PreCachedRegistrationKernel:: setTransformModel(TransformType* transform) { _spTransform = transform; }; template bool PreCachedRegistrationKernel:: transformExists() const { return _spTransform.IsNotNull(); }; template typename PreCachedRegistrationKernel::RepresentationDescriptorConstPointer PreCachedRegistrationKernel:: getLargestPossibleRepresentation() const { if (_spTransform.IsNull()) { mapDefaultExceptionStaticMacro(<< "Error. Cannot get representation descriptor in PreCachedTransformPolicy. Transform is not set."); } RepresentationDescriptorConstPointer spRepresentation; typename ::map::core::FieldDecomposer::FieldConstPointer pField; if (::map::core::FieldDecomposer::decomposeTransform(_spTransform, pField)) { spRepresentation = createFieldRepresentation(*(pField.GetPointer())); } return spRepresentation; }; template const typename PreCachedRegistrationKernel::TransformType* PreCachedRegistrationKernel:: getTransformModel() const { return _spTransform; }; template bool PreCachedRegistrationKernel:: checkAndPrepareTransform() const { return _spTransform.IsNotNull(); }; template const typename PreCachedRegistrationKernel::OutputPointType PreCachedRegistrationKernel:: getNullPoint() const { typedef itk::GenericVectorFieldTransform< ::map::core::continuous::ScalarType, VInputDimensions, VOutputDimensions> CastedTransformType; const CastedTransformType* castedTrans = dynamic_cast(_spTransform.GetPointer()); MappingVectorType result; if (castedTrans) { typedef typename MappingVectorType::Superclass VectorSuperclassType; result.VectorSuperclassType::operator = (castedTrans->GetNullPoint()); } - return result; + return result.GetDataPointer(); }; template bool PreCachedRegistrationKernel:: usesNullPoint() const { typedef itk::GenericVectorFieldTransform< ::map::core::continuous::ScalarType, VInputDimensions, VOutputDimensions> CastedTransformType; const CastedTransformType* castedTrans = dynamic_cast(_spTransform.GetPointer()); if (castedTrans) { return castedTrans->GetUseNullPoint(); } else { return false; } }; template PreCachedRegistrationKernel:: PreCachedRegistrationKernel() { }; template PreCachedRegistrationKernel:: ~PreCachedRegistrationKernel() { }; template ::itk::LightObject::Pointer PreCachedRegistrationKernel:: InternalClone() const { Pointer clone = Self::New(); clone->_spTransform = this->_spTransform; return clone.GetPointer(); } template void PreCachedRegistrationKernel:: PrintSelf(std::ostream& os, itk::Indent indent) const { Superclass::PrintSelf(os, indent); if (_spTransform.IsNotNull()) { os << indent << "Transform : " << std::endl << _spTransform << std::endl; } else { os << indent << "Transform : NULL" << std::endl; } os << indent << "Use null vector: " << this->usesNullPoint() << std::endl; os << indent << "Null vector: " << this->getNullPoint() << std::endl; }; } // end namespace core } // end namespace map #endif