diff --git a/RTToolboxConfigure.h.in b/RTToolboxConfigure.h.in index 0bfa6ad..34f0556 100644 --- a/RTToolboxConfigure.h.in +++ b/RTToolboxConfigure.h.in @@ -1,88 +1,102 @@ // ----------------------------------------------------------------------- // RTToolbox - DKFZ SIDT RT Interface // // Copyright (c) German Cancer Research Center (DKFZ), // Software development for Integrated Diagnostics and Therapy (SIDT). // ALL RIGHTS RESERVED. // See rttbCopyright.txt or // http://www.dkfz.de/en/sidt/projects/rttb/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: http://sidt-hpc1/dkfz_repository/NotMeVisLab/SIDT/RTToolbox/branch/restructure/RTToolboxConfigure.h.in $ */ //---------------------------------------------------------- // !!!EXPERIMENTAL CODE!!! // // This code may not be used for release. // Add #define SIDT_ENFORCE_MATURE_CODE to any release module // to ensure this policy. //---------------------------------------------------------- #ifdef SIDT_ENFORCE_MATURE_CODE #error “This code is marked as experimental code. It must not be used because this build enforces mature code.” #endif #ifndef SIDT_CONTAINS_EXPERIMENTAL_CODE #define SIDT_CONTAINS_EXPERIMENTAL_CODE 1 #endif /*! @def RTTB_BUILD_SHARED_LIBS * This define indicates if RTTB will be build as static library (define RTTB_STATIC) or as DLL (define RTTB_DLL). * By default RTTB_BUILD_SHARED_LIBS is not defined. */ #cmakedefine RTTB_BUILD_SHARED_LIBS #ifdef RTTB_BUILD_SHARED_LIBS #define RTTB_DLL #else #define RTTB_STATIC #endif #ifndef __RTTB_CONFIGURE_H #define __RTTB_CONFIGURE_H /*! @def RTTB_BUILD_SHARED_LIBS * This define indicates if RTTB will be build as static library (define RTTB_STATIC) or as DLL (define RTTB_DLL). * By default RTTB_BUILD_SHARED_LIBS is not defined. */ #cmakedefine RTTB_BUILD_SHARED_LIBS #ifdef RTTB_BUILD_SHARED_LIBS #define RTTB_DLL #else #define RTTB_STATIC #endif /*! @def RTTB_ENFORCE_MATURE_CODE * This define controls if RTToolbox should force the whole build to be mature code. * Mature code convention is part of the SIDT coding styles. * Projects that use RTToolbox are able to ensure with SIDT_ENFORCE_MATURE_CODE * that used code is guaranteed to be tested and reviewed regarding the strict * SIDT coding styles.\n * RTTB_ENFORCE_MATURE_CODE can be used to ensure that strictness when prebuilding * static or dynamic libraries. * @remark This definition should by configured via the advance options in CMake. */ #cmakedefine RTTB_ENFORCE_MATURE_CODE #ifdef RTTB_ENFORCE_MATURE_CODE #define SIDT_ENFORCE_MATURE_CODE #endif +/*! @def RTTB_DISABLE_ITK_IO_FACTORY_AUTO_REGISTER + * This define controls if RTToolbox should disable the auto + * register functionality of the itk io factory, when RTToolbox + * io reader and writer classes are used. + * This is needed in cases where RTToolbox is build "dynamic" and + * used in an application that also uses the ITK shared objects + * under Windows systems (e.g. MITK). Loading and unloading RTToolbox + * shared objects in such an application would lead to an corrupted + * itk factory stack, because its implementation is not fail safe + * in this scenario. + * @remark This definition should by configured via the advance options in CMake. +*/ +#cmakedefine RTTB_DISABLE_ITK_IO_FACTORY_AUTO_REGISTER + #define RTTB_VERSION_MAJOR @RTToolbox_VERSION_MAJOR@ #define RTTB_VERSION_MINOR @RTToolbox_VERSION_MINOR@ #define RTTB_VERSION_PATCH @RTToolbox_VERSION_PATCH@ #define RTTB_VERSION_STRING "@RTToolbox_VERSION_STRING@" #define RTTB_FULL_VERSION_STRING "@RTToolbox_FULL_VERSION_STRING@" #endif diff --git a/code/io/itk/rttbITKImageMaskAccessorConverter.h b/code/io/itk/rttbITKImageMaskAccessorConverter.h index 1dbb86c..c6e94af 100644 --- a/code/io/itk/rttbITKImageMaskAccessorConverter.h +++ b/code/io/itk/rttbITKImageMaskAccessorConverter.h @@ -1,68 +1,70 @@ // ----------------------------------------------------------------------- // RTToolbox - DKFZ radiotherapy quantitative evaluation library // // Copyright (c) German Cancer Research Center (DKFZ), // Software development for Integrated Diagnostics and Therapy (SIDT). // ALL RIGHTS RESERVED. // See rttbCopyright.txt or // http://www.dkfz.de/en/sidt/projects/rttb/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) */ #ifndef __ITK_IMAGE_MASK_ACCESSOR_CONVERTER_H #define __ITK_IMAGE_MASK_ACCESSOR_CONVERTER_H #include "rttbITKImageMaskAccessor.h" #include "rttbMaskAccessorProcessorBase.h" #include "../itk/rttbDoseAccessorConversionSettingInterface.h" +#include "RTTBITKIOExports.h" + namespace rttb { namespace io { namespace itk { /*! @class ITKImageMaskAccessorConverter @brief Class converts/dumps the processed accessor into an itk image @remark MaskAccessorConversionInterface defines how the converter should react on non valid Mask values. */ - class ITKImageMaskAccessorConverter: public core::MaskAccessorProcessorBase, + class RTTBITKIO_EXPORT ITKImageMaskAccessorConverter : public core::MaskAccessorProcessorBase, public rttb::core::DoseAccessorConversionSettingInterface { public: typedef core::MaskAccessorInterface::MaskAccessorPointer MaskAccessorPointer; bool process(); const ITKImageMaskAccessor::ITKMaskImageType::Pointer getITKImage() { return _itkImage; } ITKImageMaskAccessorConverter(MaskAccessorPointer accessor); virtual ~ITKImageMaskAccessorConverter() {}; private: ITKImageMaskAccessorConverter(const ITKImageMaskAccessorConverter&); //not implemented on purpose -> non-copyable ITKImageMaskAccessorConverter& operator=(const ITKImageMaskAccessorConverter&);//not implemented on purpose -> non-copyable ITKImageMaskAccessor::ITKMaskImageType::Pointer _itkImage; }; } } } #endif diff --git a/code/masks/boost/rttbBoostMaskRedesignAccessor.h b/code/masks/boost/rttbBoostMaskRedesignAccessor.h index 850c36a..8268e29 100644 --- a/code/masks/boost/rttbBoostMaskRedesignAccessor.h +++ b/code/masks/boost/rttbBoostMaskRedesignAccessor.h @@ -1,128 +1,129 @@ // ----------------------------------------------------------------------- // RTToolbox - DKFZ radiotherapy quantitative evaluation library // // Copyright (c) German Cancer Research Center (DKFZ), // Software development for Integrated Diagnostics and Therapy (SIDT). // ALL RIGHTS RESERVED. // See rttbCopyright.txt or // http://www.dkfz.de/en/sidt/projects/rttb/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: 1127 $ (last changed revision) // @date $Date: 2015-10-01 13:33:33 +0200 (Do, 01 Okt 2015) $ (last change date) // @author $Author: hentsch $ (last changed by) */ #ifndef __BOOST_MASK_R_ACCESSOR__H #define __BOOST_MASK_R_ACCESSOR__H #include "rttbBaseType.h" #include "rttbGeometricInfo.h" #include "rttbMaskVoxel.h" #include "rttbMaskAccessorInterface.h" #include "rttbGenericDoseIterator.h" #include "rttbStructure.h" #include +#include "RTTBBoostMaskExports.h" namespace rttb { namespace masks { namespace boostRedesign { /*! @class BoostMaskAccessor * @brief Using the voxelization based on boost::geometry and generate the mask accessor. * @attention If "strict" is set to true, an exception will be thrown when the given structure has self intersection. * (A structure without self interseciton means all contours of the structure have no self intersection, and * the polygons on the same slice have no intersection between each other, unless the case of a donut. A donut is accepted.) * If "strict" is set to false, debug information will be displayed when the given structure has self intersection. Self intersections will be ignored * and the mask will be calculated, however, it may cause errors in the mask results. */ - class BoostMaskAccessor: public core::MaskAccessorInterface + class RTTBBoostMask_EXPORT BoostMaskAccessor : public core::MaskAccessorInterface { public: typedef core::MaskAccessorInterface::MaskVoxelList MaskVoxelList; typedef core::MaskAccessorInterface::MaskVoxelListPointer MaskVoxelListPointer; typedef core::Structure::StructTypePointer StructTypePointer; private: core::GeometricInfo _geoInfo; /*! vector containing list of mask voxels*/ MaskVoxelListPointer _spRelevantVoxelVector; StructTypePointer _spStructure; IDType _maskUID; bool _strict; public: /*! @brief Constructor with a structure pointer and a geometric info pointer * @param aStructurePointer smart pointer of the structure * @param aGeometricInfoPtr smart pointer of the geometricinfo of the dose * @param strict indicates whether to allow self intersection in the structure. If it is set to true, an exception will be thrown when the given structure has self intersection. * @exception InvalidParameterException thrown if strict is true and the structure has self intersections */ BoostMaskAccessor(StructTypePointer aStructurePointer, const core::GeometricInfo& aGeometricInfo, bool strict = true); /*! @brief destructor*/ ~BoostMaskAccessor(); /*! @brief voxelization of the given structures using boost algorithms*/ void updateMask(); /*! @brief get vector containing all relevant voxels that are inside the given structure*/ MaskVoxelListPointer getRelevantVoxelVector(); /*! @brief get vector containing all relevant voxels that have a relevant volume above the given threshold and are inside the given structure*/ MaskVoxelListPointer getRelevantVoxelVector(float lowerThreshold); /*!@brief determine how a given voxel on the dose grid is masked * @param aID ID of the voxel in grid. * @param voxel Reference to the voxel. * @post after a valid call voxel containes the information of the specified grid voxel. If aID is not valid, voxel values are undefined. * The relevant volume fraction will be set to zero. * @return Indicates of the voxel exists and therefore if parameter voxel containes valid values.*/ bool getMaskAt(const VoxelGridID aID, core::MaskVoxel& voxel) const; /*!@brief determine how a given voxel on the dose grid is masked * @param aIndex 3d index of the voxel in grid. * @param voxel Reference to the voxel. * @return Indicates of the voxel exists and therefore if parameter voxel containes valid values.*/ bool getMaskAt(const VoxelGridIndex3D& aIndex, core::MaskVoxel& voxel) const; /*! @brief give access to GeometricInfo*/ const core::GeometricInfo& getGeometricInfo() const; /* @ brief is true if dose is on a homogeneous grid * @remark Inhomogeneous grids are not supported at the moment, but if they will be supported in the future the interface does not need to change.*/ bool isGridHomogeneous() const { return true; }; IDType getMaskUID() const { return _maskUID; }; }; } } } #endif