### Initialize and Run Web Interface Source: https://github.com/qiicr/dcmqi/wiki/JSON-generator-web-page Installs project dependencies via Bower and starts the local development server. ```bash bower install http-server app/ ``` -------------------------------- ### Install HTTP Server Source: https://github.com/qiicr/dcmqi/wiki/JSON-generator-web-page Installs the http-server package globally using npm. ```bash sudo npm install http-server -g ``` -------------------------------- ### Glob Example JSON Files Source: https://github.com/qiicr/dcmqi/blob/master/doc/CMakeLists.txt Recursively finds all JSON files that have 'example' in their name. These are used for example validation tests. ```cmake file(GLOB_RECURSE json_example_files *example*.json ) ``` -------------------------------- ### Install dcmqi via Docker Source: https://context7.com/qiicr/dcmqi/llms.txt Pull the dcmqi Docker image and run a container, mounting a local directory for data access. This example shows how to run the `itkimage2segimage` tool within the container. ```bash docker pull qiicr/dcmqi docker run -v /path/to/data:/work qiicr/dcmqi itkimage2segimage --help ``` -------------------------------- ### Configure Install Directories Source: https://github.com/qiicr/dcmqi/blob/master/CMakeLists.txt Sets default installation directories for binary, library, CMake files, include files, and documentation. These can be overridden by user-defined variables. ```cmake if(NOT DCMQI_INSTALL_BIN_DIR) set(DCMQI_INSTALL_BIN_DIR "bin") endif() if(NOT DCMQI_INSTALL_LIB_DIR) set(DCMQI_INSTALL_LIB_DIR "lib/dcmqi-${DCMQI_VERSION_MAJOR}.${DCMQI_VERSION_MINOR}") endif() if(NOT DCMQI_INSTALL_CMAKE_DIR) set(DCMQI_INSTALL_CMAKE_DIR "lib/dcmqi-${DCMQI_VERSION_MAJOR}.${DCMQI_VERSION_MINOR}/CMake") endif() if(NOT DCMQI_INSTALL_INCLUDE_DIR) set(DCMQI_INSTALL_INCLUDE_DIR "include/dcmqi-${DCMQI_VERSION_MAJOR}.${DCMQI_VERSION_MINOR}") endif() if(NOT DCMQI_INSTALL_DOC_DIR) set(DCMQI_INSTALL_DOC_DIR "doc") endif() mark_as_superbuild( DCMQI_INSTALL_BIN_DIR:STRING DCMQI_INSTALL_LIB_DIR:STRING DCMQI_INSTALL_CMAKE_DIR:STRING DCMQI_INSTALL_INCLUDE_DIR:STRING DCMQI_INSTALL_DOC_DIR:STRING ) ``` -------------------------------- ### Install dcmqi via pip Source: https://context7.com/qiicr/dcmqi/llms.txt Install the dcmqi library using pip for easy integration into Python projects. ```bash pip install dcmqi ``` -------------------------------- ### Install DCMQI Library and Headers Source: https://github.com/qiicr/dcmqi/blob/master/libsrc/CMakeLists.txt Installs the DCMQI library targets and header files to their respective destinations if export_targets is enabled. ```cmake if(export_targets) install(TARGETS ${lib_name} EXPORT ${PROJECT_NAME}Targets LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin INCLUDES DESTINATION include ) install(DIRECTORY ${INCLUDE_DIR} DESTINATION include) endif() ``` -------------------------------- ### CMake: PM Context Test Setup Source: https://github.com/qiicr/dcmqi/blob/master/doc/CMakeLists.txt Sets up the PM context schema and iterates through different PM context names, creating JSON context files and generating validation tests using `createContextTest`. ```cmake set(PM_CONTEXT_SCHEMA ${CMAKE_SOURCE_DIR}/doc/schemas/pm-context-schema.json) foreach(pm_context_name dwi dce) set(json_pm_context_file ${CMAKE_SOURCE_DIR}/doc/pmContexts/pm-${pm_context_name}-context.json) createContextTest(${pm_context_name} ${json_pm_context_file} ${PM_CONTEXT_SCHEMA} pmcontext) endforeach() ``` -------------------------------- ### Configure CPack Installation Paths Source: https://github.com/qiicr/dcmqi/blob/master/CMakeLists.txt Sets the CMake projects to be installed by CPack, including runtime libraries and specific directories. ```cmake set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${CMAKE_BINARY_DIR};${PROJECT_NAME};RuntimeLibraries;/") ``` -------------------------------- ### CMake: Segment Context Test Setup Source: https://github.com/qiicr/dcmqi/blob/master/doc/CMakeLists.txt Iterates through different segment context names, setting up JSON context files and calling the `createContextTest` function to create validation tests for each. ```cmake set(SEGMENT_CONTEXT_SCHEMA ${CMAKE_SOURCE_DIR}/doc/schemas/segment-context-schema.json) foreach(seg_context_name DICOM-Master SlicerGeneralAnatomy) set(json_seg_context_file ${CMAKE_SOURCE_DIR}/doc/segContexts/SegmentationCategoryTypeModifier-${seg_context_name}.json) createContextTest(${seg_context_name} ${json_seg_context_file} ${SEGMENT_CONTEXT_SCHEMA} segcontext) endforeach() ``` -------------------------------- ### Conditionally Add DCMTK and ITK Installation Paths Source: https://github.com/qiicr/dcmqi/blob/master/CMakeLists.txt Adds DCMTK and ITK installation paths to CPack if their respective cmake_install.cmake files exist. ```cmake if(EXISTS "${DCMTK_DIR}/cmake_install.cmake") set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${DCMTK_DIR};DCMTK;shlib;/") endif() if(EXISTS "${ITK_DIR}/cmake_install.cmake") set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ITK_DIR};ITK;RuntimeLibraries;/") endif() ``` -------------------------------- ### CMake: Anatomic Context Test Setup Source: https://github.com/qiicr/dcmqi/blob/master/doc/CMakeLists.txt Iterates through anatomic context names, defining the schema and JSON context file paths, then calls `createContextTest` to generate validation tests. ```cmake set(ANATOMIC_CONTEXT_SCHEMA ${CMAKE_SOURCE_DIR}/doc/schemas/anatomic-context-schema.json) foreach(anatomic_context_name DICOM-Master) set(json_anatomic_context_file ${CMAKE_SOURCE_DIR}/doc/segContexts/AnatomicRegionAndModifier-${anatomic_context_name}.json) createContextTest(${anatomic_context_name} ${json_anatomic_context_file} ${ANATOMIC_CONTEXT_SCHEMA} anatomiccontext) endforeach() ``` -------------------------------- ### Find DCMQI Package Source: https://github.com/qiicr/dcmqi/blob/master/apps/paramaps/CMakeLists.txt Finds the DCMQI package. Ensure DCMQI is installed or its source directory is available. ```cmake if(NOT DCMQI_SOURCE_DIR AND NOT Slicer_SOURCE_DIR) find_package(DCMQI REQUIRED) endif() ``` -------------------------------- ### Segmentation JSON Metadata Example Source: https://context7.com/qiicr/dcmqi/llms.txt Example JSON metadata file defining series-level attributes and segment-specific properties, including SNOMED-CT codes for semantic description. The `segmentAttributes` field maps labels to their properties. ```json { "@schema": "https://raw.githubusercontent.com/qiicr/dcmqi/master/doc/schemas/seg-schema.json#", "ContentCreatorName": "Doe^John", "ClinicalTrialSeriesID": "Session1", "ClinicalTrialTimePointID": "1", "ClinicalTrialCoordinatingCenterName": "BWH", "SeriesDescription": "Liver and Spine Segmentation", "SeriesNumber": "300", "InstanceNumber": "1", "segmentAttributes": [ [ { "labelID": 1, "SegmentDescription": "Liver Segmentation", "SegmentLabel": "Liver", "SegmentedPropertyCategoryCodeSequence": { "CodeValue": "85756007", "CodingSchemeDesignator": "SCT", "CodeMeaning": "Tissue" }, "SegmentedPropertyTypeCodeSequence": { "CodeValue": "10200004", "CodingSchemeDesignator": "SCT", "CodeMeaning": "Liver" }, "SegmentAlgorithmType": "SEMIAUTOMATIC", "SegmentAlgorithmName": "SlicerEditor", "recommendedDisplayRGBValue": [221, 130, 101], "TrackingIdentifier": "Liver", "TrackingUniqueIdentifier": "1.2.3" }, { "labelID": 2, "SegmentDescription": "Anatomical Structure", "SegmentLabel": "Thoracic spine", "SegmentedPropertyTypeCodeSequence": { "CodeMeaning": "Thoracic spine", "CodingSchemeDesignator": "SCT", "CodeValue": "122495006" }, "SegmentedPropertyCategoryCodeSequence": { "CodeMeaning": "Anatomical Structure", "CodingSchemeDesignator": "SCT", "CodeValue": "123037004" }, "SegmentAlgorithmType": "MANUAL", "recommendedDisplayRGBValue": [226, 202, 134] } ] ] } ``` -------------------------------- ### Display Help for segimage2itkimage Source: https://github.com/qiicr/dcmqi/blob/master/apps/seg/Testing/CMakeLists.txt This test simply executes the `segimage2itkimage` command with the `--help` flag to display its usage information. This is a basic check to ensure the executable is available and responds to help requests. ```cmake dcmqi_add_test( NAME ${dcm2itk}_hello MODULE_NAME ${MODULE_NAME} COMMAND $ --help) ``` -------------------------------- ### DCMTK and Include Directories Configuration Source: https://github.com/qiicr/dcmqi/blob/master/libsrc/CMakeLists.txt Determines the DCMTK libraries and include directories, then sets the include directories for the DCMQI library, including external dependencies like DCMTK, ITK, and JsonCpp. ```cmake set(_dcmtk_libs) set(_dcmtk_includes) if(TARGET DCMTK::DCMTK) set(_dcmtk_libs DCMTK::DCMTK) else() set(_dcmtk_libs ${DCMTK_LIBRARIES}) set(_dcmtk_includes ${DCMTK_INCLUDE_DIRS}) endif() set(${lib_name}_INCLUDE_DIRS ${_dcmtk_includes} ${ITK_INCLUDE_DIRS} ${JsonCpp_INCLUDE_DIR} $ $ ) if(ITK_INSTALL_PREFIX) if(EXISTS ${ITK_INSTALL_PREFIX}/include/vxl/core AND EXISTS ${ITK_INSTALL_PREFIX}/include/vxl/vcl) list(APPEND ${lib_name}_INCLUDE_DIRS ${ITK_INSTALL_PREFIX}/include/vxl/core ${ITK_INSTALL_PREFIX}/include/vxl/vcl ) endif() endif() target_include_directories(${lib_name} PUBLIC ${${lib_name}_INCLUDE_DIRS}) ``` -------------------------------- ### Set CPack Description Files Source: https://github.com/qiicr/dcmqi/blob/master/CMakeLists.txt Specifies the README.md file for the package description and the extension description summary. ```cmake set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/README.md) set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${EXTENSION_DESCRIPTION}) ``` -------------------------------- ### Configure Output Directories Source: https://github.com/qiicr/dcmqi/blob/master/CMakeLists.txt Iterates through library, runtime, and archive types to set their output directories. It ensures directories exist and configures them based on the superbuild setting. ```cmake foreach(type LIBRARY RUNTIME ARCHIVE) # Make sure the directory exists if(DEFINED DCMQI_CMAKE_${type}_OUTPUT_DIRECTORY AND NOT EXISTS ${DCMQI_CMAKE_${type}_OUTPUT_DIRECTORY}) message(FATAL_ERROR "DCMQI_CMAKE_${type}_OUTPUT_DIRECTORY is set to a non-existing directory [${DCMQI_CMAKE_${type}_OUTPUT_DIRECTORY}]") endif() if(DCMQI_SUPERBUILD) set(output_dir ${DCMQI_BINARY_DIR}/bin) if(NOT DEFINED DCMQI_CMAKE_${type}_OUTPUT_DIRECTORY) set(DCMQI_CMAKE_${type}_OUTPUT_DIRECTORY ${DCMQI_BINARY_DIR}/${PROJECT_NAME_LC}-build/bin) endif() mark_as_superbuild(DCMQI_CMAKE_${type}_OUTPUT_DIRECTORY:PATH) else() if(NOT DEFINED DCMQI_CMAKE_${type}_OUTPUT_DIRECTORY) set(output_dir ${DCMQI_BINARY_DIR}/bin) else() set(output_dir ${DCMQI_CMAKE_${type}_OUTPUT_DIRECTORY}) endif() endif() set(CMAKE_${type}_OUTPUT_DIRECTORY ${output_dir} CACHE INTERNAL "Single output directory for building all libraries.") endforeach() ``` -------------------------------- ### Configure dcmqi segmentation test environment Source: https://github.com/qiicr/dcmqi/blob/master/apps/seg/Testing/CMakeLists.txt Sets up the module name, baseline directories, and temporary directory for segmentation tests. ```cmake include(dcmqiTest) #----------------------------------------------------------------------------- set(MODULE_NAME segmentation) #----------------------------------------------------------------------------- set(BASELINE ${CMAKE_SOURCE_DIR}/data/segmentations) set(DICOM_DIR ${BASELINE}/ct-3slice) set(MODULE_TEMP_DIR ${TEMP_DIR}/seg) make_directory(${MODULE_TEMP_DIR}) ``` -------------------------------- ### Set CPack Project Configuration File Source: https://github.com/qiicr/dcmqi/blob/master/CMakeLists.txt Ensures DCMQI_CPACK_PROJECT_CONFIG_FILE is defined and sets it for CPack. ```cmake if(NOT DEFINED DCMQI_CPACK_PROJECT_CONFIG_FILE) message(FATAL_ERROR "DCMQI_CPACK_PROJECT_CONFIG_FILE is not defined") endif() set(CPACK_PROJECT_CONFIG_FILE "${DCMQI_CPACK_PROJECT_CONFIG_FILE}") ``` -------------------------------- ### Build tid1500reader CLI Module Source: https://github.com/qiicr/dcmqi/blob/master/apps/sr/CMakeLists.txt Configures the build for the tid1500reader command-line interface module, linking against the dcmqi library. ```cmake set(MODULE_NAME tid1500reader) SEMMacroBuildCLI( NAME ${MODULE_NAME} TARGET_LIBRARIES dcmqi EXECUTABLE_ONLY ) ``` -------------------------------- ### Include CPack Module Source: https://github.com/qiicr/dcmqi/blob/master/CMakeLists.txt Includes the CPack module to enable packaging functionality. ```cmake include(CPack) ``` -------------------------------- ### Include Slicer Extension Configuration Source: https://github.com/qiicr/dcmqi/blob/master/CMakeLists.txt Includes CMake scripts for Slicer extension configuration and CPack if Slicer_DIR is defined. ```cmake include(${Slicer_EXTENSION_GENERATE_CONFIG}) include(${Slicer_EXTENSION_CPACK}) ``` -------------------------------- ### Configure Slicer Extension Build Option Source: https://github.com/qiicr/dcmqi/blob/master/CMakeLists.txt Sets the default for building DCMQI as a Slicer Extension. It defaults to ON if Slicer_DIR is defined, otherwise OFF. ```cmake set(_default OFF) set(_reason "DCMQI_BUILD_SLICER_EXTENSION is ON") if(NOT DEFINED DCMQI_BUILD_SLICER_EXTENSION AND DEFINED Slicer_DIR) set(_default ON) set(_reason "Slicer_DIR is SET") endif() option(DCMQI_BUILD_SLICER_EXTENSION "Build as a Slicer Extension" ${_default}) ``` -------------------------------- ### Build paramap2itkimage CLI Tool Source: https://github.com/qiicr/dcmqi/blob/master/apps/paramaps/CMakeLists.txt Defines the build target for the 'paramap2itkimage' command-line interface tool, linking against the dcmqi library. ```cmake set(MODULE_NAME paramap2itkimage) SEMMacroBuildCLI( NAME ${MODULE_NAME} TARGET_LIBRARIES dcmqi EXECUTABLE_ONLY ) ``` -------------------------------- ### Execute dcmqi via Docker Source: https://context7.com/qiicr/dcmqi/llms.txt Provides commands for pulling the dcmqi image and performing common conversion tasks using mounted volumes for data access. ```bash # Pull the latest image docker pull qiicr/dcmqi # Convert segmentation with mounted volumes docker run -v /local/data:/work qiicr/dcmqi \ itkimage2segimage \ --inputDICOMDirectory /work/source_dicom/ \ --inputImageList /work/segmentation.nrrd \ --inputMetadata /work/metadata.json \ --outputDICOM /work/output.dcm # Extract segmentation from DICOM docker run -v /local/data:/work qiicr/dcmqi \ segimage2itkimage \ --inputDICOM /work/segmentation.dcm \ --outputDirectory /work/extracted/ # Create measurement report docker run -v /local/data:/work qiicr/dcmqi \ tid1500writer \ --inputMetadata /work/measurements.json \ --inputCompositeContextDirectory /work/context/ \ --inputImageLibraryDirectory /work/images/ \ --outputDICOM /work/report.dcm ``` -------------------------------- ### Build tid1500writer CLI Module Source: https://github.com/qiicr/dcmqi/blob/master/apps/sr/CMakeLists.txt Configures the build for the tid1500writer command-line interface module, linking against the dcmqi library. ```cmake set(MODULE_NAME tid1500writer) SEMMacroBuildCLI( NAME ${MODULE_NAME} TARGET_LIBRARIES dcmqi EXECUTABLE_ONLY ) ``` -------------------------------- ### Define DCMQI Library Source: https://github.com/qiicr/dcmqi/blob/master/libsrc/CMakeLists.txt Defines the DCMQI library as a static library, listing all its header and source files, including additional files if DCMQI_BUILTIN_JSONCPP is enabled. ```cmake set(ADDITIONAL_HDRS) set(ADDITIONAL_SRCS) set(INCLUDE_DIR ../include/dcmqi) set(HDRS ${INCLUDE_DIR}/preproc.h ${INCLUDE_DIR}/QIICRConstants.h ${INCLUDE_DIR}/QIICRUIDs.h ${INCLUDE_DIR}/Bin2Label.h ${INCLUDE_DIR}/ConverterBase.h ${INCLUDE_DIR}/Dicom2ItkConverterBase.h ${INCLUDE_DIR}/Dicom2ItkConverterBin.h ${INCLUDE_DIR}/Dicom2ItkConverterLabel.h ${INCLUDE_DIR}/Exceptions.h ${INCLUDE_DIR}/Itk2DicomConverter.h ${INCLUDE_DIR}/ParaMapConverter.h ${INCLUDE_DIR}/Helper.h ${INCLUDE_DIR}/ColorUtilities.h ${INCLUDE_DIR}/JSONMetaInformationHandlerBase.h ${INCLUDE_DIR}/JSONParametricMapMetaInformationHandler.h ${INCLUDE_DIR}/JSONSegmentationMetaInformationHandler.h ${INCLUDE_DIR}/SegmentAttributes.h ${INCLUDE_DIR}/TID1500Reader.h ) set(SRCS Bin2Label.cpp ConverterBase.cpp Dicom2ItkConverterBase.cpp Dicom2ItkConverterBin.cpp Dicom2ItkConverterLabel.cpp ParaMapConverter.cpp Helper.cpp ColorUtilities.cpp Itk2DicomConverter.cpp JSONMetaInformationHandlerBase.cpp JSONParametricMapMetaInformationHandler.cpp JSONSegmentationMetaInformationHandler.cpp SegmentAttributes.cpp TID1500Reader.cpp ) if(DCMQI_BUILTIN_JSONCPP) list(APPEND ADDITIONAL_HDRS ${DCMQI_SOURCE_DIR}/jsoncpp/json/json.h ${DCMQI_SOURCE_DIR}/jsoncpp/json/json-forwards.h ) list(APPEND ADDITIONAL_SRCS ${DCMQI_SOURCE_DIR}/jsoncpp/jsoncpp.cpp ) set(JsonCpp_INCLUDE_DIR $) install(DIRECTORY ${INCLUDE_DIR} ../jsoncpp/json DESTINATION include) endif() set(lib_name dcmqi) add_library(${lib_name} STATIC ${HDRS} ${SRCS} ${ADDITIONAL_HDRS} ${ADDITIONAL_SRCS} ) ``` -------------------------------- ### Configure DCMQI CLI Modules with CMake Source: https://github.com/qiicr/dcmqi/blob/master/apps/seg/CMakeLists.txt Uses SEMMacroBuildCLI to define CLI modules and applies NOMINMAX definitions on Windows to prevent macro name clashes. ```cmake # # DCMQI # if(NOT DCMQI_SOURCE_DIR AND NOT Slicer_SOURCE_DIR) find_package(DCMQI REQUIRED) endif() # # SlicerExecutionModel # find_package(SlicerExecutionModel REQUIRED) include(${SlicerExecutionModel_USE_FILE}) #----------------------------------------------------------------------------- set(MODULE_NAME segimage2itkimage) #----------------------------------------------------------------------------- SEMMacroBuildCLI( NAME ${MODULE_NAME} TARGET_LIBRARIES dcmqi EXECUTABLE_ONLY ) if(WIN32) # Due to name clash of "max" macro, build may fail error on Windows without defining NOMINMAX. target_compile_definitions(${MODULE_NAME}Lib PRIVATE NOMINMAX) endif() #----------------------------------------------------------------------------- set(MODULE_NAME itkimage2segimage) #----------------------------------------------------------------------------- SEMMacroBuildCLI( NAME ${MODULE_NAME} TARGET_LIBRARIES dcmqi EXECUTABLE_ONLY ) if(WIN32) # Due to name clash of "max" macro, build may fail error on Windows without defining NOMINMAX. target_compile_definitions(${MODULE_NAME}Lib PRIVATE NOMINMAX) endif() #----------------------------------------------------------------------------- set(MODULE_NAME bin2labelsegimage) #----------------------------------------------------------------------------- SEMMacroBuildCLI( NAME ${MODULE_NAME} TARGET_LIBRARIES dcmqi EXECUTABLE_ONLY ) if(WIN32) # Due to name clash of "max" macro, build may fail error on Windows without defining NOMINMAX. target_compile_definitions(${MODULE_NAME}Lib PRIVATE NOMINMAX) endif() #----------------------------------------------------------------------------- if(BUILD_TESTING) add_subdirectory(Testing) endif() ``` -------------------------------- ### Add Subdirectories for Build Components Source: https://github.com/qiicr/dcmqi/blob/master/CMakeLists.txt This snippet adds subdirectories for building the library, applications, and documentation. Application and documentation builds are conditional. ```cmake add_subdirectory("libsrc") if(DCMQI_BUILD_APPS) add_subdirectory("apps") endif() if(DCMQI_BUILD_DOC) add_subdirectory("doc") endif() ``` -------------------------------- ### Generate DCMQIConfig.cmake Source: https://github.com/qiicr/dcmqi/blob/master/CMakeLists.txt This section generates the DCMQIConfig.cmake and DCMQIConfigVersion.cmake files for package configuration. It sets up path variables and configures the package using CMakePackageConfigHelpers. ```cmake if(NOT Slicer_DIR) include(CMakePackageConfigHelpers) set(path_vars CONFIG_DIR_CONFIG DCMTK_DIR_CONFIG ) if(DCMQI_BUILD_APPS) list(APPEND path_vars SlicerExecutionModel_DIR_CONFIG ) endif() set(CONFIG_DIR_CONFIG ${CMAKE_BINARY_DIR}) set(DCMTK_DIR_CONFIG ${DCMTK_DIR}) set(SlicerExecutionModel_DIR_CONFIG ${SlicerExecutionModel_DIR}) set(${PROJECT_NAME}_CONFIG_CODE "####### Expanded from \@DCMQI_CONFIG_CODE\@ #######\n") set(${PROJECT_NAME}_CONFIG_CODE "${${PROJECT_NAME}_CONFIG_CODE}find_package(DCMTK NO_MODULE REQUIRED)\n") set(${PROJECT_NAME}_CONFIG_CODE "${${PROJECT_NAME}_CONFIG_CODE}find_package(ITK NO_MODULE REQUIRED)\n") set(${PROJECT_NAME}_CONFIG_CODE "${${PROJECT_NAME}_CONFIG_CODE}set(DCMQI_BUILD_APPS ${DCMQI_BUILD_APPS})\n") set(${PROJECT_NAME}_CONFIG_CODE "${${PROJECT_NAME}_CONFIG_CODE}##################################################") set(_config ${CMAKE_BINARY_DIR}/${PROJECT_NAME}Config.cmake) configure_package_config_file( CMake/${PROJECT_NAME}Config.cmake.in ${_config} INSTALL_DESTINATION ${CMAKE_BINARY_DIR} PATH_VARS ${path_vars} NO_CHECK_REQUIRED_COMPONENTS_MACRO ) set(CONFIG_DIR_CONFIG cmake) set(_install_config ${CMAKE_BINARY_DIR}/CMakeFiles/${PROJECT_NAME}Config.cmake) configure_package_config_file( CMake/${PROJECT_NAME}Config.cmake.in ${_install_config} INSTALL_DESTINATION ${CMAKE_BINARY_DIR} PATH_VARS ${path_vars} NO_CHECK_REQUIRED_COMPONENTS_MACRO ) write_basic_package_version_file( ${CMAKE_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake VERSION ${DCMQI_VERSION} COMPATIBILITY ExactVersion ) if(export_targets) install(EXPORT ${PROJECT_NAME}Targets DESTINATION cmake ) install(FILES ${_install_config} DESTINATION cmake ) install(FILES ${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake DESTINATION cmake ) install(EXPORT ${PROJECT_NAME}Targets FILE ${PROJECT_NAME}Targets.cmake DESTINATION cmake ) install(DIRECTORY ${PROJECT_BINARY_DIR}/include DESTINATION .) endif() endif() ``` -------------------------------- ### Convert Parametric Maps with C++ API Source: https://context7.com/qiicr/dcmqi/llms.txt Demonstrates the conversion between ITK images and DICOM Parametric Map objects using the ParaMapConverter class. Requires an ITK image reader and appropriate JSON metadata. ```cpp #include #include using namespace dcmqi; // Read parametric map image typedef itk::Image FloatImageType; typedef itk::ImageFileReader FloatReaderType; FloatReaderType::Pointer reader = FloatReaderType::New(); reader->SetFileName("adc_map.nrrd"); reader->Update(); // Load source DICOM datasets vector dcmDatasets; // ... load DICOM files // JSON metadata string metaData = R"({ "SeriesDescription": "ADC Map", "QuantityValueCode": { "CodeValue": "113041", "CodingSchemeDesignator": "DCM", "CodeMeaning": "Apparent Diffusion Coefficient" }, "MeasurementUnitsCode": { "CodeValue": "um2/s", "CodingSchemeDesignator": "UCUM", "CodeMeaning": "um2/s" }, "DerivationCode": { "CodeValue": "113041", "CodingSchemeDesignator": "DCM", "CodeMeaning": "Apparent Diffusion Coefficient" }, "AnatomicRegionSequence": { "CodeValue": "41216001", "CodingSchemeDesignator": "SCT", "CodeMeaning": "Prostate" }, "FrameLaterality": "U" })"; // Convert ITK to DICOM Parametric Map DcmDataset* pmapDataset = ParaMapConverter::itkimage2paramap( reader->GetOutput(), dcmDatasets, metaData, true // doDicomValueChecks ); // Convert DICOM Parametric Map back to ITK auto [floatImage, extractedMetadata] = ParaMapConverter::paramap2itkimage(pmapDataset); ``` -------------------------------- ### Find and Include Slicer Package Source: https://github.com/qiicr/dcmqi/blob/master/CMakeLists.txt Finds the Slicer package if DCMQI_BUILD_SLICER_EXTENSION is enabled and includes its use file. ```cmake if(DCMQI_BUILD_SLICER_EXTENSION) find_package(Slicer REQUIRED) include(${Slicer_USE_FILE}) mark_as_superbuild(Slicer_DIR) endif() ``` -------------------------------- ### Build itkimage2paramap CLI Tool Source: https://github.com/qiicr/dcmqi/blob/master/apps/paramaps/CMakeLists.txt Defines the build target for the 'itkimage2paramap' command-line interface tool, linking against the dcmqi library. ```cmake set(MODULE_NAME itkimage2paramap) SEMMacroBuildCLI( NAME ${MODULE_NAME} TARGET_LIBRARIES dcmqi EXECUTABLE_ONLY ) ``` -------------------------------- ### Set CPack Package Information Source: https://github.com/qiicr/dcmqi/blob/master/CMakeLists.txt Defines the name, vendor, and version for the CPack package. ```cmake set(CPACK_PACKAGE_NAME "dcmqi") set(CPACK_PACKAGE_VENDOR "Quantitative Image Informatics for Cancer Research (QIICR)") set(CPACK_PACKAGE_VERSION_MAJOR ${DCMQI_VERSION_MAJOR}) set(CPACK_PACKAGE_VERSION_MINOR ${DCMQI_VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_PATCH ${DCMQI_VERSION_PATCH}) ``` -------------------------------- ### Perform Metadata Roundtrip Comparison Source: https://github.com/qiicr/dcmqi/blob/master/apps/sr/Testing/CMakeLists.txt Compares input and output JSON metadata using a Python script to ensure data integrity. ```cmake dcmqi_add_test( NAME ${MODULE_NAME}_meta_roundtrip MODULE_NAME ${READER_MODULE_NAME} COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/util/comparejson.py ${EXAMPLES}/sr-tid1500-ct-liver-example.json ${MODULE_TEMP_DIR}/sr-tid1500-ct-liver-example.json "['activitySession', 'timePoint', 'imageLibrary', 'compositeContext','procedureReported']" TEST_DEPENDS ${READER_MODULE_NAME}_ct-liver ) ``` -------------------------------- ### Link DCMQI Library Dependencies Source: https://github.com/qiicr/dcmqi/blob/master/libsrc/CMakeLists.txt Links the DCMQI library against its required dependencies, including DCMTK, ITK, and optionally JsonCpp. ```cmake target_link_libraries(${lib_name} PUBLIC ${_dcmtk_libs} ${ITK_LIBRARIES} $<$>:${JsonCpp_LIBRARY}> ) ``` -------------------------------- ### Set CPack Package File Name Source: https://github.com/qiicr/dcmqi/blob/master/CMakeLists.txt Constructs the package file name using the package name, version, and system name. ```cmake set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${DCMQI_VERSION}-${CPACK_SYSTEM_NAME}") ``` -------------------------------- ### Find DCMTK and ITK Packages Source: https://github.com/qiicr/dcmqi/blob/master/CMakeLists.txt This snippet finds the DCMTK and ITK packages, which are required for the project. It includes the ITK usage file. ```cmake find_package(DCMTK NO_MODULE REQUIRED) find_package(ITK NO_MODULE REQUIRED) include(${ITK_USE_FILE}) ``` -------------------------------- ### Set Library Version Properties Source: https://github.com/qiicr/dcmqi/blob/master/CMakeLists.txt Appends version information (VERSION and SOVERSION) to library target properties if DCMQI_NO_LIBRARY_VERSION is not set. ```cmake if(NOT DCMQI_NO_LIBRARY_VERSION) set(DCMQI_LIBRARY_PROPERTIES ${DCMQI_LIBRARY_PROPERTIES} VERSION "${DCMQI_VERSION}" SOVERSION "${DCMQI_VERSION_MAJOR}.${DCMQI_VERSION_MINOR}" ) endif() ``` -------------------------------- ### Configure Version Information Target Source: https://github.com/qiicr/dcmqi/blob/master/CMakeLists.txt This snippet includes a CMake module to configure version information and adds a dependency on the generated version target. ```cmake include(dcmqiConfigureVersionTarget) add_dependencies(dcmqi dcmqiConfigureVersion) ``` -------------------------------- ### Include SlicerExecutionModel Source: https://github.com/qiicr/dcmqi/blob/master/apps/paramaps/CMakeLists.txt Finds and includes the SlicerExecutionModel package, which is required for building CLI tools. ```cmake find_package(SlicerExecutionModel REQUIRED) include(${SlicerExecutionModel_USE_FILE}) ``` -------------------------------- ### Log Slicer Extension Build Status Source: https://github.com/qiicr/dcmqi/blob/master/CMakeLists.txt Logs whether DCMQI is being built as a Slicer extension based on the configured option. ```cmake set(_msg "Checking if building as a Slicer extension") message(STATUS ${_msg}) if(DCMQI_BUILD_SLICER_EXTENSION) message(STATUS "${_msg} - yes (${_reason})") else() message(STATUS "${_msg} - no (DCMQI_BUILD_SLICER_EXTENSION is OFF)") endif() ``` -------------------------------- ### Validate 16-bit MONOCHROME2 Labelmap with dcm2itkTest Source: https://github.com/qiicr/dcmqi/blob/master/apps/seg/Testing/CMakeLists.txt Validates a generated 16-bit MONOCHROME2 labelmap against a baseline using the `dcm2itkTest` tool. This requires the output from the `liver_to_labelmap_mono16` test. ```cmake dcmqi_add_test( NAME ${dcm2itk}_labelmap_mono16 MODULE_NAME ${MODULE_NAME} COMMAND $ --compare ${BASELINE}/liver_seg.nrrd ${MODULE_TEMP_DIR}/labelmap_mono16-1.nrrd ${dcm2itk}Test --inputDICOM ${MODULE_TEMP_DIR}/liver-labelmap-mono16.dcm --outputDirectory ${MODULE_TEMP_DIR} --outputType nrrd --prefix labelmap_mono16 TEST_DEPENDS liver_to_labelmap_mono16 ) set_tests_properties(${dcm2itk}_labelmap_mono16 PROPERTIES FIXTURES_REQUIRED liver_labelmap_mono16 ) ``` -------------------------------- ### Convert ITK Image to DICOM Segmentation (Advanced) Source: https://context7.com/qiicr/dcmqi/llms.txt Perform a conversion with compression enabled, verbose output, and skipping initial frames. Useful for optimizing output size and debugging. ```bash itkimage2segimage \ --inputDICOMDirectory ./source_dicom/ \ --inputImageList segmentation.nrrd \ --inputMetadata metadata.json \ --outputDICOM output.dcm \ --compress deflate \ --verbose \ --skip 1 ``` -------------------------------- ### Convert ITK Image to DICOM Segmentation (Basic) Source: https://context7.com/qiicr/dcmqi/llms.txt Perform a basic conversion of a single segmentation file to a DICOM Segmentation Object. Requires source DICOM images, the segmentation file, and metadata. ```bash itkimage2segimage \ --inputDICOMDirectory ./source_dicom/ \ --inputImageList liver_seg.nrrd \ --inputMetadata seg-metadata.json \ --outputDICOM liver_segmentation.dcm ``` -------------------------------- ### Convert Binary to Labelmap Segmentation Source: https://context7.com/qiicr/dcmqi/llms.txt Convert binary 1-bit DICOM Segmentation Images to labelmap DICOM Segmentation Images using bin2labelsegimage. Supports RLE compression and palette color options. ```bash # Basic conversion bin2labelsegimage \ --inputDICOM binary_seg.dcm \ --outputDICOM labelmap_seg.dcm # With RLE compression and palette color bin2labelsegimage \ --inputDICOM binary_seg.dcm \ --outputDICOM labelmap_seg.dcm \ --compress rle \ --usePalette \ --verbose ``` -------------------------------- ### Add Sample Segmentation to Labelmap Conversion Test Source: https://github.com/qiicr/dcmqi/blob/master/apps/seg/Testing/CMakeLists.txt Adds a test to convert a sample DICOM segmentation file to a labelmap DICOM file using the seg2labelmap tool. This is part of a loop iterating through different sample segmentation files. ```cmake dcmqi_add_test( NAME ${more_test_labelmap}_to_labelmap MODULE_NAME ${MODULE_NAME} COMMAND $ --inputDICOM ${CMAKE_SOURCE_DIR}/data/segmentations/${more_test_labelmap}.dcm --outputDICOM ${MODULE_TEMP_DIR}/${more_test_labelmap}-labelmap.dcm ) ``` -------------------------------- ### Add 8-bit PALETTE COLOR Labelmap Conversion Test Source: https://github.com/qiicr/dcmqi/blob/master/apps/seg/Testing/CMakeLists.txt Adds a test for converting a DICOM SEG to an 8-bit PALETTE COLOR labelmap DICOM using seg2labelmap. It uses the --usePalette option and requires the itk2dcm_makeSEG test. ```cmake dcmqi_add_test( NAME liver_to_labelmap_palette8 MODULE_NAME ${MODULE_NAME} COMMAND $ --inputDICOM ${MODULE_TEMP_DIR}/liver.dcm --outputDICOM ${MODULE_TEMP_DIR}/liver-labelmap-palette8.dcm --compress none --usePalette TEST_DEPENDS ${itk2dcm}_makeSEG ) set_tests_properties(liver_to_labelmap_palette8 PROPERTIES FIXTURES_REQUIRED liver_seg_dcm FIXTURES_SETUP liver_labelmap_palette8 ) ``` -------------------------------- ### Convert Segmentation to 16-bit MONOCHROME2 Labelmap Source: https://github.com/qiicr/dcmqi/blob/master/apps/seg/Testing/CMakeLists.txt Converts a DICOM segmentation to a 16-bit MONOCHROME2 labelmap. Ensure the `seg2labelmap` tool and necessary dependencies are available. ```cmake dcmqi_add_test( NAME liver_to_labelmap_mono16 MODULE_NAME ${MODULE_NAME} COMMAND $ --inputDICOM ${MODULE_TEMP_DIR}/liver.dcm --outputDICOM ${MODULE_TEMP_DIR}/liver-labelmap-mono16.dcm --compress none --force16Bit TEST_DEPENDS ${itk2dcm}_makeSEG ) set_tests_properties(liver_to_labelmap_mono16 PROPERTIES FIXTURES_REQUIRED liver_seg_dcm FIXTURES_SETUP liver_labelmap_mono16 ) ``` -------------------------------- ### Determine CPack System Name Source: https://github.com/qiicr/dcmqi/blob/master/CMakeLists.txt Sets the CPACK_SYSTEM_NAME based on the operating system and processor architecture. ```cmake if(CMAKE_SYSTEM_NAME MATCHES "Darwin") set(CPACK_SYSTEM_NAME "mac-${CMAKE_SYSTEM_PROCESSOR}") elseif(CMAKE_SYSTEM_NAME MATCHES "Linux") set(CPACK_SYSTEM_NAME "linux") elseif(CMAKE_SYSTEM_NAME MATCHES "Windows") if(CMAKE_SIZEOF_VOID_P EQUAL 8) set(CPACK_SYSTEM_NAME win64) else() set(CPACK_SYSTEM_NAME win32) endif() endif() ``` -------------------------------- ### Set Target Properties Source: https://github.com/qiicr/dcmqi/blob/master/libsrc/CMakeLists.txt Applies specific properties to the DCMQI library target if DCMQI_LIBRARY_PROPERTIES is defined. ```cmake if(DCMQI_LIBRARY_PROPERTIES) set_target_properties(${lib_name} PROPERTIES ${DCMQI_LIBRARY_PROPERTIES}) endif() ``` -------------------------------- ### Add dcm2itk 8-bit MONOCHROME2 Labelmap Test Source: https://github.com/qiicr/dcmqi/blob/master/apps/seg/Testing/CMakeLists.txt Adds a test to convert an 8-bit MONOCHROME2 labelmap DICOM back to NRRD using dcm2itkTest. It compares the output NRRD with a baseline and depends on the liver_to_labelmap_mono8 test. ```cmake dcmqi_add_test( NAME ${dcm2itk}_labelmap_mono8 MODULE_NAME ${MODULE_NAME} COMMAND $ --compare ${BASELINE}/liver_seg.nrrd ${MODULE_TEMP_DIR}/labelmap_mono8-1.nrrd ${dcm2itk}Test --inputDICOM ${MODULE_TEMP_DIR}/liver-labelmap-mono8.dcm --outputDirectory ${MODULE_TEMP_DIR} --outputType nrrd --prefix labelmap_mono8 TEST_DEPENDS liver_to_labelmap_mono8 ) set_tests_properties(${dcm2itk}_labelmap_mono8 PROPERTIES FIXTURES_REQUIRED liver_labelmap_mono8 ) ``` -------------------------------- ### Add 8-bit MONOCHROME2 Labelmap Conversion Test Source: https://github.com/qiicr/dcmqi/blob/master/apps/seg/Testing/CMakeLists.txt Adds a test for converting a DICOM SEG to an 8-bit MONOCHROME2 labelmap DICOM using seg2labelmap. It specifies no compression and requires the itk2dcm_makeSEG test. ```cmake dcmqi_add_test( NAME liver_to_labelmap_mono8 MODULE_NAME ${MODULE_NAME} COMMAND $ --inputDICOM ${MODULE_TEMP_DIR}/liver.dcm --outputDICOM ${MODULE_TEMP_DIR}/liver-labelmap-mono8.dcm --compress none TEST_DEPENDS ${itk2dcm}_makeSEG ) set_tests_properties(liver_to_labelmap_mono8 PROPERTIES FIXTURES_REQUIRED liver_seg_dcm FIXTURES_SETUP liver_labelmap_mono8 ) ``` -------------------------------- ### Add Test for NRRD Parametric Map Generation (256x256) Source: https://github.com/qiicr/dcmqi/blob/master/apps/paramaps/Testing/CMakeLists.txt Configures a CMake test to generate a NRRD parametric map from DICOM input and compare it with a baseline. Requires the `itk2dcm` tool for map generation. ```cmake dcmqi_add_test( NAME ${dcm2itk}_makeNRRDParametricMapNoDerImg256x256 MODULE_NAME ${MODULE_NAME} RESOURCE_LOCK ${MODULE_TEMP_DIR}/pmap.nrrd COMMAND $ --compare ${BASELINE}/pm-example-3slices-256x256.nrrd ${MODULE_TEMP_DIR}/makeNRRDParametricMap-3slices-256x256-pmap.nrrd ${dcm2itk}Test --inputDICOM ${MODULE_TEMP_DIR}/paramap-3slices-256x256.dcm --outputDirectory ${MODULE_TEMP_DIR} --prefix makeNRRDParametricMap-3slices-256x256 TEST_DEPENDS ${itk2dcm}_makeParametricMapNoDerImg256x256 ) ``` -------------------------------- ### Configure Superbuild Option Source: https://github.com/qiicr/dcmqi/blob/master/CMakeLists.txt Defines the option to enable or disable the superbuild mode, which builds DCMQI and its dependencies. It is enabled by default. ```cmake option(DCMQI_SUPERBUILD "Build ${PROJECT_NAME} and the projects it depends on." ${superbuild_default}) mark_as_advanced(DCMQI_SUPERBUILD) ``` -------------------------------- ### Validate 16-bit PALETTE COLOR Labelmap with dcm2itkTest Source: https://github.com/qiicr/dcmqi/blob/master/apps/seg/Testing/CMakeLists.txt Validates a generated 16-bit PALETTE COLOR labelmap against a baseline using `dcm2itkTest`. This test depends on the successful completion of the `liver_to_labelmap_palette16` conversion. ```cmake dcmqi_add_test( NAME ${dcm2itk}_labelmap_palette16 MODULE_NAME ${MODULE_NAME} COMMAND $ --compare ${BASELINE}/liver_seg.nrrd ${MODULE_TEMP_DIR}/labelmap_palette16-1.nrrd ${dcm2itk}Test --inputDICOM ${MODULE_TEMP_DIR}/liver-labelmap-palette16.dcm --outputDirectory ${MODULE_TEMP_DIR} --outputType nrrd --prefix labelmap_palette16 TEST_DEPENDS liver_to_labelmap_palette16 ) set_tests_properties(${dcm2itk}_labelmap_palette16 PROPERTIES FIXTURES_REQUIRED liver_labelmap_palette16 ) ``` -------------------------------- ### Configure macOS rpath Source: https://github.com/qiicr/dcmqi/blob/master/CMakeLists.txt Ensures CMAKE_MACOSX_RPATH is set to 1 on macOS for proper library loading. ```cmake if(NOT DEFINED CMAKE_MACOSX_RPATH) set(CMAKE_MACOSX_RPATH 1) endif() mark_as_superbuild( VARS CMAKE_MACOSX_RPATH:BOOL ALL_PROJECTS ) ``` -------------------------------- ### Set CPack Generator Type Source: https://github.com/qiicr/dcmqi/blob/master/CMakeLists.txt Selects the CPack generator (TGZ for Unix, ZIP for Windows) based on the operating system. ```cmake if(UNIX) set(CPACK_GENERATOR "TGZ") elseif(WIN32) set(CPACK_GENERATOR "ZIP") endif() ``` -------------------------------- ### Glob JSON Files Source: https://github.com/qiicr/dcmqi/blob/master/doc/CMakeLists.txt Recursively finds all JSON files in the project directory. This is used for general JSON syntax validation. ```cmake file(GLOB_RECURSE json_files *.json ) ``` -------------------------------- ### Glob Segmentation Context JSON Files Source: https://github.com/qiicr/dcmqi/blob/master/doc/CMakeLists.txt Finds JSON files related to segmentation contexts. These are likely used for specific schema validation. ```cmake file(GLOB json_seg_context_files segContexts/Segmentation*json ) ``` -------------------------------- ### CMake Function to Create Context Tests Source: https://github.com/qiicr/dcmqi/blob/master/doc/CMakeLists.txt Defines a CMake function that creates a test using the AJV executable to validate JSON context files against schema files. It skips test creation if the AJV executable is not found. ```cmake function(createContextTest context_name json_context_file schema_file suffix) set(testname ajv_${context_name}-${suffix}) if(AJV_EXECUTABLE) add_test(NAME ${testname} # -d stands for data that needs to be validated COMMAND ${AJV_EXECUTABLE} -s ${schema_file} ${common_schema_references} -d ${json_context_file} ${AJV_OPTIONS}) set_property(TEST ${testname} PROPERTY LABELS ajv) else() message(STATUS "Skipping '${testname}' test: ajv executable not found") endif() endfunction() ``` -------------------------------- ### Add dcm2itk 8-bit PALETTE COLOR Labelmap Test Source: https://github.com/qiicr/dcmqi/blob/master/apps/seg/Testing/CMakeLists.txt Adds a test to convert an 8-bit PALETTE COLOR labelmap DICOM back to NRRD using dcm2itkTest. It compares the output NRRD with a baseline and depends on the liver_to_labelmap_palette8 test. ```cmake dcmqi_add_test( NAME ${dcm2itk}_labelmap_palette8 MODULE_NAME ${MODULE_NAME} COMMAND $ --compare ${BASELINE}/liver_seg.nrrd ${MODULE_TEMP_DIR}/labelmap_palette8-1.nrrd ${dcm2itk}Test --inputDICOM ${MODULE_TEMP_DIR}/liver-labelmap-palette8.dcm --outputDirectory ${MODULE_TEMP_DIR} --outputType nrrd --prefix labelmap_palette8 TEST_DEPENDS liver_to_labelmap_palette8 ) set_tests_properties(${dcm2itk}_labelmap_palette8 PROPERTIES FIXTURES_REQUIRED liver_labelmap_palette8 ) ``` -------------------------------- ### Add Test for NRRD Parametric Map Generation (252x255) Source: https://github.com/qiicr/dcmqi/blob/master/apps/paramaps/Testing/CMakeLists.txt Configures a CMake test to generate a NRRD parametric map from DICOM input and compare it with a baseline. Requires the `itk2dcm` tool for map generation. ```cmake dcmqi_add_test( NAME ${dcm2itk}_makeNRRDParametricMapNoDerImg252x255 MODULE_NAME ${MODULE_NAME} RESOURCE_LOCK ${MODULE_TEMP_DIR}/pmap.nrrd COMMAND $ --compare ${BASELINE}/pm-example-3slices-252x255.nrrd ${MODULE_TEMP_DIR}/makeNRRDParametricMap-3slices-252x255-pmap.nrrd ${dcm2itk}Test --inputDICOM ${MODULE_TEMP_DIR}/paramap-3slices-252x255.dcm --outputDirectory ${MODULE_TEMP_DIR} --prefix makeNRRDParametricMap-3slices-252x255 TEST_DEPENDS ${itk2dcm}_makeParametricMapNoDerImg252x255 ) ``` -------------------------------- ### Define dcmqi segmentation tests Source: https://github.com/qiicr/dcmqi/blob/master/apps/seg/Testing/CMakeLists.txt Defines CMake tests for the itkimage2segimage tool, including help command and segmentation generation. ```cmake set(itk2dcm itkimage2segimage) dcmqi_add_test( NAME ${itk2dcm}_hello MODULE_NAME ${MODULE_NAME} COMMAND $ --help ) dcmqi_add_test( NAME ${itk2dcm}_makeSEG MODULE_NAME ${MODULE_NAME} COMMAND $ --inputMetadata ${CMAKE_SOURCE_DIR}/doc/examples/seg-example.json --inputImageList ${BASELINE}/liver_seg.nrrd --inputDICOMDirectory ${DICOM_DIR} --outputDICOM ${MODULE_TEMP_DIR}/liver.dcm ) ``` ```cmake dcmqi_add_test( NAME ${itk2dcm}_makeSEG_merged_segment_files_from_partial_overlap MODULE_NAME ${MODULE_NAME} COMMAND $ --inputMetadata ${CMAKE_SOURCE_DIR}/doc/examples/seg-example_partial_overlaps.json --inputImageList ${BASELINE}/partial_overlaps-1.nrrd,${BASELINE}/partial_overlaps-2.nrrd,${BASELINE}/partial_overlaps-3.nrrd --inputDICOMList ${DICOM_DIR}/01.dcm,${DICOM_DIR}/02.dcm,${DICOM_DIR}/03.dcm --outputDICOM ${MODULE_TEMP_DIR}/partial_overlaps.dcm --useLabelIDAsSegmentNumber ) ```