BICCN / cell-locator

manually align specimens to annotated 3D spaces
https://cell-locator.readthedocs.io
Other
19 stars 7 forks source link

Release Installer size is larger than expected #159

Open jcfr opened 3 years ago

jcfr commented 3 years ago

Description

The size of the installer (843MB vs 215MB) is partially explained by the fact the MNI atlas is now shipped with the application. We noticed that the install rules were installing the complete download folders instead of selectively installing the relevant MNI files.

See https://github.com/BICCN/cell-locator/releases

Screenshots

image

image

jcfr commented 3 years ago

the install rules for the data files are implemented here:

https://github.com/BICCN/cell-locator/blob/5e4c3941613427674709bd241622588404ad7042/Modules/Scripted/Home/CMakeLists.txt#L80-L86

That said the problem is related to the install rule of the scripted modules.

Indeed, the content of the D:\D\P\CL-0-build\Slicer-build\E\Modules\Scripted\Home\cmake_install.cmake file generated is the following. Despite of selectively listing the data files, the parent folder is systematically copied.

[...]

if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xRuntimeLibrariesx" OR NOT CMAKE_INSTALL_COMPONENT)
  file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/./lib/CellLocator-4.13/qt-scripted-modules" TYPE DIRECTORY FILES "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/" USE_SOURCE_PERMISSIONS)
endif()

if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xRuntimeLibrariesx" OR NOT CMAKE_INSTALL_COMPONENT)
  file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/./lib/CellLocator-4.13/qt-scripted-modules" TYPE FILE FILES
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/ccf_average_template_25.nrrd"
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/ccf_annotation_25_contiguous.nrrd"
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/ccf_annotation_color_table.txt"
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/ccf_annotation_color_allen2slicer_mapping.json"
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/ccf_annotation_color_slicer2allen_mapping.json"
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/ccf-ontology-formatted.json"
    )
endif()

if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xRuntimeLibrariesx" OR NOT CMAKE_INSTALL_COMPONENT)
  file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/./lib/CellLocator-4.13/qt-scripted-modules" TYPE FILE FILES
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/mni_icbm152_t1_tal_nlin_sym_09b_hires.nii"
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/mni_annotation_contiguous.nrrd"
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/mni_annotation_color_table.txt"
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/mni_annotation_color_allen2slicer_mapping.json"
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/mni_annotation_color_slicer2allen_mapping.json"
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/mni-ontology-formatted.json"
    )
endif()

if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xRuntimeLibrariesx" OR NOT CMAKE_INSTALL_COMPONENT)
  file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/./lib/CellLocator-4.13/qt-scripted-modules" TYPE FILE FILES
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/ccf_annotation_layer_color_table.txt"
    "D:/D/P/CL-0-build/Slicer-build/lib/CellLocator-4.13/qt-scripted-modules/CellLocatorData/ccf-layer-ontology-formatted.json"
    )
endif()
jcfr commented 3 years ago

The macro responsible for installing the module is slicerMacroBuildScriptedModule:

https://github.com/BICCN/cell-locator/blob/5e4c3941613427674709bd241622588404ad7042/Modules/Scripted/Home/CMakeLists.txt#L33-L38

and looking at the implementation, we can observe that the directory is always installed:

https://github.com/KitwareMedical/Slicer/blob/7fde09a0168d0b2e6f2a12ad01a18ac2889da7a1/CMake/SlicerMacroBuildScriptedModule.cmake#L105-L106

Fixing ctkMacroCompilePythonScript used in slicerMacroBuildScriptedModule to explicitly install each files would be ideal.

But since this may be a more involved change, we could look into few approaches:

References: