diff --git a/Modules/BasicImageProcessing/CMakeLists.txt b/Modules/BasicImageProcessing/CMakeLists.txt index cc5646ff2e..2f337313f9 100644 --- a/Modules/BasicImageProcessing/CMakeLists.txt +++ b/Modules/BasicImageProcessing/CMakeLists.txt @@ -1,10 +1,8 @@ MITK_CREATE_MODULE( DEPENDS MitkCore PACKAGE_DEPENDS PUBLIC PRIVATE ITK|ITKIOImageBase+ITKIOGDCM ) add_subdirectory(MiniApps) -#add_subdirectory(autoload/IO) -#add_subdirectory(test) diff --git a/Modules/BasicImageProcessing/MiniApps/CMakeLists.txt b/Modules/BasicImageProcessing/MiniApps/CMakeLists.txt index 20999bbd67..ffe47d678a 100644 --- a/Modules/BasicImageProcessing/MiniApps/CMakeLists.txt +++ b/Modules/BasicImageProcessing/MiniApps/CMakeLists.txt @@ -1,87 +1,87 @@ -option(BUILD_ClassificationMiniApps "Build commandline tools for classification" OFF) +option(BUILD_BasicImageProcessingMiniApps "Build commandline tools for Basic Image Processing" OFF) -if(BUILD_ClassificationMiniApps OR MITK_BUILD_ALL_APPS) +if(BUILD_BasicImageProcessingMiniApps OR MITK_BUILD_ALL_APPS) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ) # list of miniapps # if an app requires additional dependencies # they are added after a "^^" and separated by "_" - set( classificationminiapps + set( basicImageProcessingMiniApps FileConverter^^MitkCore ) - foreach(classificationminiapps ${classificationminiapps}) + foreach(basicImageProcessingMiniApp ${basicImageProcessingMiniApps}) # extract mini app name and dependencies - string(REPLACE "^^" "\\;" miniapp_info ${classificationminiapps}) + string(REPLACE "^^" "\\;" miniapp_info ${basicImageProcessingMiniApp}) set(miniapp_info_list ${miniapp_info}) list(GET miniapp_info_list 0 appname) list(GET miniapp_info_list 1 raw_dependencies) string(REPLACE "_" "\\;" dependencies "${raw_dependencies}") set(dependencies_list ${dependencies}) mitk_create_executable(${appname} DEPENDS MitkCore MitkCommandLine ${dependencies_list} PACKAGE_DEPENDS ITK CPP_FILES ${appname}.cpp ) # CPP_FILES ${appname}.cpp mitkCommandLineParser.cpp if(EXECUTABLE_IS_ENABLED) # On Linux, create a shell script to start a relocatable application if(UNIX AND NOT APPLE) install(PROGRAMS "${MITK_SOURCE_DIR}/CMake/RunInstalledApp.sh" DESTINATION "." RENAME ${EXECUTABLE_TARGET}.sh) endif() get_target_property(_is_bundle ${EXECUTABLE_TARGET} MACOSX_BUNDLE) if(APPLE) if(_is_bundle) set(_target_locations ${EXECUTABLE_TARGET}.app) set(${_target_locations}_qt_plugins_install_dir ${EXECUTABLE_TARGET}.app/Contents/MacOS) set(_bundle_dest_dir ${EXECUTABLE_TARGET}.app/Contents/MacOS) set(_qt_plugins_for_current_bundle ${EXECUTABLE_TARGET}.app/Contents/MacOS) set(_qt_conf_install_dirs ${EXECUTABLE_TARGET}.app/Contents/Resources) install(TARGETS ${EXECUTABLE_TARGET} BUNDLE DESTINATION . ) else() if(NOT MACOSX_BUNDLE_NAMES) set(_qt_conf_install_dirs bin) set(_target_locations bin/${EXECUTABLE_TARGET}) set(${_target_locations}_qt_plugins_install_dir bin) install(TARGETS ${EXECUTABLE_TARGET} RUNTIME DESTINATION bin) else() foreach(bundle_name ${MACOSX_BUNDLE_NAMES}) list(APPEND _qt_conf_install_dirs ${bundle_name}.app/Contents/Resources) set(_current_target_location ${bundle_name}.app/Contents/MacOS/${EXECUTABLE_TARGET}) list(APPEND _target_locations ${_current_target_location}) set(${_current_target_location}_qt_plugins_install_dir ${bundle_name}.app/Contents/MacOS) message( " set(${_current_target_location}_qt_plugins_install_dir ${bundle_name}.app/Contents/MacOS) ") install(TARGETS ${EXECUTABLE_TARGET} RUNTIME DESTINATION ${bundle_name}.app/Contents/MacOS/) endforeach() endif() endif() else() set(_target_locations bin/${EXECUTABLE_TARGET}${CMAKE_EXECUTABLE_SUFFIX}) set(${_target_locations}_qt_plugins_install_dir bin) set(_qt_conf_install_dirs bin) install(TARGETS ${EXECUTABLE_TARGET} RUNTIME DESTINATION bin) endif() endif() endforeach() # On Linux, create a shell script to start a relocatable application if(UNIX AND NOT APPLE) install(PROGRAMS "${MITK_SOURCE_DIR}/CMake/RunInstalledApp.sh" DESTINATION "." RENAME ${EXECUTABLE_TARGET}.sh) endif() if(EXECUTABLE_IS_ENABLED) MITK_INSTALL_TARGETS(EXECUTABLES ${EXECUTABLE_TARGET}) endif() endif() diff --git a/Modules/BasicImageProcessing/files.cmake b/Modules/BasicImageProcessing/files.cmake index 943cb59c2c..7389f67eff 100644 --- a/Modules/BasicImageProcessing/files.cmake +++ b/Modules/BasicImageProcessing/files.cmake @@ -1,9 +1,9 @@ file(GLOB_RECURSE H_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/include/*") set(CPP_FILES - + mitkEmptyClass.cpp ) set(RESOURCE_FILES ) diff --git a/Modules/BasicImageProcessing/include/mitkCESTImageNormalizationFilter.h b/Modules/BasicImageProcessing/include/mitkCESTImageNormalizationFilter.h deleted file mode 100644 index 563fa22545..0000000000 --- a/Modules/BasicImageProcessing/include/mitkCESTImageNormalizationFilter.h +++ /dev/null @@ -1,79 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ -#ifndef __mitkCESTImageNormalizationFilter_h -#define __mitkCESTImageNormalizationFilter_h - -#include - -// MITK -#include "mitkImageToImageFilter.h" - -namespace mitk -{ - /** \brief Normalization filter for CEST images. - * - * This filter can be used to normalize CEST images, it only works with 4D images and assumes that the input - * mitk::Image has a property called mitk::CustomTagParser::m_OffsetsPropertyName, whith offsets separated by - * spaces. The number of offsets has to match the number of timesteps. - * - * Each timestep with a corresponding offset greater than 299 or less than -299 will be interpreted as normalization (M0) image. - * If only one M0 image is present normalization will be done by dividing the voxel value by the corresponding - * M0 voxel value. If multiple M0 images are present normalization between any two M0 images will be done by - * dividing by a linear interpolation between the two. - * The M0 images themselves will be transferred to the result without any processing. - * - * The output image will have the same geometry as the input image and a double pixel type. - */ - class MITKCEST_EXPORT CESTImageNormalizationFilter : public ImageToImageFilter - { - public: - mitkClassMacro(CESTImageNormalizationFilter, ImageToImageFilter); - itkFactorylessNewMacro(Self) itkCloneMacro(Self) - - protected: - /*! - \brief standard constructor - */ - CESTImageNormalizationFilter(); - /*! - \brief standard destructor - */ - ~CESTImageNormalizationFilter() override; - /*! - \brief Method generating the output information of this filter (e.g. image dimension, image type, etc.). - The interface ImageToImageFilter requires this implementation. Everything is taken from the input image. - */ - void GenerateOutputInformation() override; - /*! - \brief Method generating the output of this filter. Called in the updated process of the pipeline. - This method generates the normalized output image. - */ - void GenerateData() override; - - /** Internal templated method that normalizes across timesteps - */ - template - void NormalizeTimeSteps(const itk::Image* image); - - /// Offsets without M0s - std::string m_RealOffsets; - - /// non M0 indices - std::vector< unsigned int > m_NonM0Indices; - - }; -} // END mitk namespace -#endif diff --git a/Modules/BasicImageProcessing/include/mitkCustomTagParser.h b/Modules/BasicImageProcessing/include/mitkCustomTagParser.h deleted file mode 100644 index 7a53928ef1..0000000000 --- a/Modules/BasicImageProcessing/include/mitkCustomTagParser.h +++ /dev/null @@ -1,123 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#ifndef MITKCUSTOMTAGPARSER_H -#define MITKCUSTOMTAGPARSER_H - -#include -#include - -#include - -namespace mitk -{ - /** - The custom tag parser can be used to parse the custom dicom tag of the siemens private tag - (0x0029, 0x1020) to extract relevant CEST data. - - An initial parsing determines whether the provided string belongs to CEST data at all. - If the "tSequenceFileName" is of the format "{WHATEVER}CEST_Rev####" it is assumed that the - data is indeed CEST data and was taken with revision #### (not limited to four digits). - - Which custom parameters to save and to which property name can be controlled by a json file. - This file can be either provided as a resource for the MitkCEST module during compilation or - placed next to the MitkCEST library in your binary folder. - - The expected format for the file "REVISIONNUMBER.json":
- {
- "REVISIONNUMBER" : "revision_json",
- "sWiPMemBlock.alFree[1]" : "AdvancedMode",
- "sWiPMemBlock.alFree[2]" : "RetreatMode"
- }
- - where : -
    -
  • REVISIONNUMBER is the revision number of this json parameter mapping (files with non digit characters in their - name will be ignored) -
  • sWiPMemBlock.alFree[1] is the name of one parameter in the private dicom tag -
  • AdvancedMode is the name of the property the content of sWiPMemBlock.alFree[1] should be saved to -
- - \note It is assumed that the entire content of tag (0x0029, 0x1020) is provided and that it es hex encoded - (12\23\04...). - - If the sampling type is list it will try to access LIST.txt at the location provided in the constructor to - read the offsets. - */ - class MITKCEST_EXPORT CustomTagParser - { - public: - /// the constructor expects a path to one of the files to be loaded or the directory of the dicom files - CustomTagParser(std::string relevantFile); - - /// parse the provided dicom property and return a property list based on the closest revision parameter mapping - mitk::PropertyList::Pointer ParseDicomProperty(mitk::TemporoSpatialStringProperty *dicomProperty); - /// parse the provided string and return a property list based on the closest revision parameter mapping - mitk::PropertyList::Pointer ParseDicomPropertyString(std::string dicomPropertyString); - - void SetParseStrategy(std::string parseStrategy); - void SetRevisionMappingStrategy(std::string revisionMappingStrategy); - - /// name of the property for the offsets, including normalization offsets - static const std::string m_OffsetsPropertyName; - - /// name of the property for the data acquisition revision - static const std::string m_RevisionPropertyName; - - /// name of the property for the json parameter mapping revision - static const std::string m_JSONRevisionPropertyName; - - /// prefix for all CEST related property names - static const std::string m_CESTPropertyPrefix; - - protected: - std::string GetRevisionAppropriateJSONString(std::string revisionString); - void GetClosestLowerRevision(std::string revisionString); - std::string GetClosestLowerRevision(std::string revisionString, std::vector availableRevisionsVector); - - /// Decides whether or not the image is likely to be a T1Map, if not it is assumed to be a CEST sequence - bool IsT1Sequence(std::string preparationType, std::string recoveryMode, std::string spoilingType, std::string revisionString); - - /// Get a string filled with the properly formated offsets based on the sampling type and offset - std::string GetOffsetString(std::string samplingType, std::string offset, std::string measurements); - - /// returns a vector revision numbers of all REVISIONNUMBER.json found beside the MitkCEST library - std::vector GetExternalRevisions(); - /// returns a vector revision numbers of all REVISIONNUMBER.json provided as resources during the compile - std::vector GetInternalRevisions(); - - /// returns the path where external jsons are expected to be located - std::string GetExternalJSONDirectory(); - - /// the closest lower revision provided as resource, empty if none found - std::string m_ClosestInternalRevision; - /// the closest lower revision provided as a json beside the library, empty if none found - std::string m_ClosestExternalRevision; - - /// revision independent mapping to inject into the revision dependent json string - static const std::string m_RevisionIndependentMapping; - /// default revision dependent json string if none is found - static const std::string m_DefaultJsonString; - /// path to the dicom data - std::string m_DicomDataPath; - /// Should the kind of data be automatically determined or should it be parsed as a specific one - std::string m_ParseStrategy; - /// How to handle parameter mapping based on absent revision jsons - std::string m_RevisionMappingStrategy; - }; -} - -#endif // MITKCUSTOMTAGPARSER_H diff --git a/Modules/BasicImageProcessing/include/mitkEmptyClass.h b/Modules/BasicImageProcessing/include/mitkEmptyClass.h new file mode 100644 index 0000000000..40d7618255 --- /dev/null +++ b/Modules/BasicImageProcessing/include/mitkEmptyClass.h @@ -0,0 +1,11 @@ +#ifndef mitkEmptyClass_h +#define mitkEmptyClass_h + + +class mitkEmptyClass { + public: + int m_Meaningless; + void foo(); +} + +#enddef \ No newline at end of file diff --git a/Modules/BasicImageProcessing/src/mitkEmptyClass.cpp b/Modules/BasicImageProcessing/src/mitkEmptyClass.cpp new file mode 100644 index 0000000000..4be193b9f8 --- /dev/null +++ b/Modules/BasicImageProcessing/src/mitkEmptyClass.cpp @@ -0,0 +1,5 @@ +#include + +void mitkEmptyClass::foo(){ + +}; \ No newline at end of file