CamiTK Community Edition issueshttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues2024-03-25T18:19:08+01:00https://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/183Update Windows toolchain and docker fo CI2024-03-25T18:19:08+01:00Emmanuel PromayonUpdate Windows toolchain and docker fo CI| | |
|--|--|
| **As a** | CamiTK developer |
| **I would like to** | have a new toolchain on windows and a new docker image for CI |
| **So that** | I spend less time on installing and building CamiTK CE |
| | |
|--|--|
| **As a** | CE...| | |
|--|--|
| **As a** | CamiTK developer |
| **I would like to** | have a new toolchain on windows and a new docker image for CI |
| **So that** | I spend less time on installing and building CamiTK CE |
| | |
|--|--|
| **As a** | CEP developer on Windows |
| **I would like to** | have a simpler way to install the toolchain and develop my extension |
| **So that** | I spend less time on the setup and have less difficulties to develop on Windows |
## Description / Overview
Windows setup is fastidious and can have side effect on the installation (or the local installation can have side effect on the CEP development, e.g. installation of some LaTeX software provides Qt DLL that conflict with the CamiTK setup).
Some package/dev environment setup systems exist on Windows
- [msys2](https://www.msys2.org/) has an [extensive list of available packages](https://github.com/msys2/MINGW-packages), and a [good documentation](https://www.msys2.org/docs/package-management/). The compiler is mingw64.
- chocolatey (that what is used at the moment). The compiler is MSVC
- [vcpkg](https://learn.microsoft.com/en-us/vcpkg/get_started/overview).
This issue contains many aspect and:
- must answer the question : Should we move to msys2 or vcpkg or stay on chocolatey+MSVC?
- must provide a new toolchain documentation
- must provide a new docker image for CI
- (if possible) must provide a new documentation on how to use the docker image to develop on windows without installing software
See:
- [msys2 description](https://www.msys2.org/docs/what-is-msys2/)
- [project that use msys2](https://www.msys2.org/docs/who-is-using-msys2/), to check how they use it, what's the impact on their toolchain, and how they manage their CI (e.g., [inkscape](https://wiki.inkscape.org/wiki/Compiling_Inkscape_on_Windows_with_MSYS2) and [inkscape CI on gitlab.com](https://gitlab.com/inkscape/inkscape/-/raw/master/buildtools/msys2installdeps.sh)).
- [dockerization tentative for msys2](https://github.com/Amitie10g/docker-msys2)
If MSys2 is adopted:
- All dependencies library should be available (xerces-c,...), including some that are not directly used in CCE but are known to be used/supported in CEPs (e.g., opencv, SDL2,...)
- MSC++ will not be used as the default compiler on windows (subsidiary question: does it have other side effects? Any impact on the future python binding?)
- that reinforce the recommendation of vscode as an ide on all platform (see #181), including windows [mingw for vscode documentation](https://code.visualstudio.com/docs/cpp/config-mingw#_adding-additional-cc-settings)
**Additional questions**
- impact CI performance (subsidiary question: is there a way to optimize the docker handling by windows? Is win11 better than win10 for handling containerized toolchain?)
- can the window docker image be used to build and run CEPs by CEP developers. That would certainly ease the setup process and will have zero impact on the developer installation. Iit is probably easy to build a CEP from vscode + devcontainer using the window docker image, but it might be harder/not possible/not efficient to run `camitk-imp` from the docker container → that remain to be tested!
- :warning: **CMake macros.** Some CamiTK CMake code (configuration and CI) depends on checking if the compiler is MSVC. There might be some problems to fix there as well if changing to mingw64.
- using mingw64 might automatically close #64 (declimport/declexport). But then another decision will have to be taken about what to do with legacy code (remove the macros for managing declimport/declexport or not). And also a decision has to be taken for using the CMake property from now on...
## Acceptance tests
- [ ] Internal document to explain the decision
- [ ] window docker image for CI (updated or renewed)
- [ ] re-generate the CamiTK5.2 package using the new image (to test the release process for future release)
- [ ] update website setup documentation
- [ ] update [support policy web page](https://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/DevTeam/camitk-website/-/blob/master/content/en/docs/advanced%20topics/developers/support%20policy.md)
- [ ] in the `develop` branch check `CMakeLists.txt` for minimal version and check if update is required
- [ ] in the `develop` branch move version requirements for the tests (VTK and ITK version) and update test file if required. For instance : `component-stl-level3-2`, `vtkimage`...
- [ ] update release documentation to add a step that uses the Windows toolchain and solve the compiler/linker warnings before adding the release tag (same as the clang)
**Note** Use tag `:2025` for the image instead of `5.3` (change of docker image naming convention)Emmanuel PromayonEmmanuel Promayonhttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/182Update Ubuntu docker fo CI2024-03-22T18:08:56+01:00Emmanuel PromayonUpdate Ubuntu docker fo CIUpdate LTS docker image using Ubuntu 24.04 LTS Noble [Numbat](https://en.wikipedia.org/wiki/Numbat) that [will be released at the end of April](https://discourse.ubuntu.com/t/noble-numbat-release-schedule/35649)
**Question to answer:**
...Update LTS docker image using Ubuntu 24.04 LTS Noble [Numbat](https://en.wikipedia.org/wiki/Numbat) that [will be released at the end of April](https://discourse.ubuntu.com/t/noble-numbat-release-schedule/35649)
**Question to answer:**
- if the windows tool chain migrates to MSys2 (i.e. using mingw64 compiler instead of MSC++), would it not be better to use lvm instead of gcc on LTS so that there are at least two big compiler family in the CI?
**Note**
Use tag `:2025` for the image instead of `5.3` (change of docker image naming convention)
***Note***
Depends on Ubuntu 24.04 release, this should be planned for may/june.
- [ ] update Dockerfile
- [ ] setup CI using new image
- [ ] push image to gitlab
- [ ] update website setup documentation
- [ ] update [support policy web page](https://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/DevTeam/camitk-website/-/blob/master/content/en/docs/advanced%20topics/developers/support%20policy.md)
- [ ] in the `develop` branch check `CMakeLists.txt` for minimal version and check if update is required
- [ ] in the `develop` branch move version requirements for the tests (VTK and ITK version) and update test file if required. For instance : `component-stl-level3-2`, `vtkimage`...Emmanuel PromayonEmmanuel Promayonhttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/181VS Code extension pack and settings for CamiTK developers2024-03-25T15:25:09+01:00Emmanuel PromayonVS Code extension pack and settings for CamiTK developers| | |
|--|--|
| **As a** | CEP developer |
| **I would like to** | have guideline and default settings for Visual Studio Code / codium |
| **So that** | I can quickly start and efficiently develop my CamiTK extension |
## Description /...| | |
|--|--|
| **As a** | CEP developer |
| **I would like to** | have guideline and default settings for Visual Studio Code / codium |
| **So that** | I can quickly start and efficiently develop my CamiTK extension |
## Description / Overview
This should supersede Issue #143.
VS Code / Codium is more and more used among developers, including C++ developers. It has many advantages over previous recommended solution (e.g., KDevelop, Visual Studio):
- it supports both Linux and Windows the same way
- it is versatile as you can use it to write code, markdown documentation or report, article with LaTeX...
- it can be used to develop inside docker containers
- it integrates every tools that makes it easier for developer (debugger, git...)
[Check the google trend](https://trends.google.com/trends/explore?date=today%205-y&q=%2Fm%2F0134xwrk,%2Fm%2F01r_y0,%2Fm%2F08rjyp,%2Fm%2F063zx_g,%2Fg%2F11c3kh6nh5)
It would be nice for developers if the CamiTK team recommend a list of extension and/or provide a default `VS code` configuration file that sets everything up.
## Hints
List of currently used and recommended (to cleanup/update/verify/classify in subcategories):
- MS C/C++ / MS C/C++ Extension pack
- native debug
- CMake Tools and CMake
- astyle + astyle configuration (in `${workspaceRoot}/.vscode/astylerc`)
- TODO highlight
- MS Dev Containers
- Git : git graph ???, GitLab Workflow???, GitLens ???
We can also have recommandation for other categories such as: markdown preview enhanced, markdownlint, LTeX grammar check, Atom One light theme, better C++ syntax, bookmarks, code spell checker, docker, LaTeX Workshop, project manager, Paste image, how to install plantuml local server, ...
See also [old internal doc](https://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/DevTeam/pilotage-technique/-/blob/e0f41e6493af51d73614f1a61932efee48b8ed0b/sp%C3%A9cifications/vs%20code/vs%20code.md)
## Acceptance tests
A progressive list of deliverables
- [ ] Website page describing the recommended extensions
- [ ] add the command to install the extensions (from the command line and from inside code) in the website page
- [ ] add the recommended way to install VS code and codium depending on the OS
- [ ] create a CamiTK extension pack [see this](https://code.visualstudio.com/blogs/2017/03/07/extension-pack-roundup) [or that](https://www.digitalocean.com/community/tutorials/how-to-create-an-extension-pack-for-visual-studio-code)
- [ ] configuration template in the CamiTK Community Edition source (something like `.vscode/.vscode-template` or at the user level in `~/.config`)
- [ ] configuration template `.devcontainer` for working inside docker containers
## Trackhttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/180Simplify CamiTKVersion.h management2024-02-23T11:20:59+01:00Emmanuel PromayonSimplify CamiTKVersion.h management| | |
|--|--|
| **As a** | CamiTK developer and packager |
| **I would like to** | simplify the release and packaging process |
| **So that** | it would be easier to publish and package a new version |
| **Epic/Topics** | release managem...| | |
|--|--|
| **As a** | CamiTK developer and packager |
| **I would like to** | simplify the release and packaging process |
| **So that** | it would be easier to publish and package a new version |
| **Epic/Topics** | release management |
## Description / Overview
This point for this issue is:
- gather explanation about/rationale behind the existence of `CamiTKVersion.h` and `CamiTKVersion.h.in` file
- explain some consequence of the existence of this file
- work on how it can be simplified
## Hints
`CamiTKVersion.h` contains static information about the version number, debug postfix and `libDir`.
This file generates some complicated maneuvers during release management and packaging (see below).
### Some background on plugins
- CamiTK has a core library and uses plugins to add I/O (components), processing (actions) and viewer functionalities
- the plugins are made available using .so stored in "camitk repository", a directory that has a specific structure with subdirectories to sort plugins depending on their nature (actions, components, viewers)
- at run time, the core library looks into different paths for locating the existing camitk repositories (working directory, user installed, locally installed, or globally installed) in order to dynamically load all the available plugins.
- The libDir variable is used to check the camitk repository paths, that should all be ending with "some/path/" + libDir + "/camitk-x.y" (where x.y are major.minor camitk version numbers).
- The CamiTKVersion.h header file is used to specify this statically.
- On the upstream develop branch, libDir is generated at configure time by CMake, using the CMAKE_INSTALL_LIBDIR variable which is either set to "lib/ARCH" (if CMAKE_INSTALL_PATH is set to "/usr") or to just "lib/" (if CMAKE_INSTALL_PATH is empty).
- on the upstream master branch (the stable version, used to generate the tar ball), this is fixed to "lib". **TODO: describe rationale behind this**
### Generated burden
It might not be the best way to proceed, it is a bit complicated... That's what we came up with at the time (pre 2011) to answer to the following support constraints :
- multiple os,
- multiple camitk repositories,
- and multiple build situation (inbuild, sdk, install, cep dev)
It looks more like technical debt and could probably be simplified as it impact
- the release management process
- the packaging process (s.g. during 5.2 release `CamiTKVersion.h` was different on debian salsa master and in the upstream tarball), see also d/r and the line that uses `sed` to correct the file on debian...
### Note on `libDir` introduction in CamiTK version
`libDir` in CamiTKVersion was introduced #109 and #117 (commit de1794622009c4edd6cf4220773b61dbd644c37e) in order to support gentoo, and was later modified to take into account more situations:
- lib (default)
- lib64 (used on some Linux/platform)
- lib/<multiarch-tuple> (on Debian)
### Fixing this issue
Fixing this issue can be done either by
- option 1: confirming that a static `CamiTKVersion.h` (part of all of it) is required in `master`
- option 2: removing `CamiTKVersion.h` in master and generated release version tarball
## Acceptance tests
- [ ] option 1: better documentation to explain why a static `CamiTKVersion.h` is required
- [ ] option 2: a branch fixing this issue is merged (therefore CI passed)
- [ ] option 2: successful debian packaging process test
## Track
## Misc
- Automatic subscription of issue creator:https://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/179Persistence: select parts to save, support Action properties, automatic actio...2024-03-26T19:15:48+01:00Manik BhattacharjeePersistence: select parts to save, support Action properties, automatic action replay and processing scenarios in camitk files## About you
CamiTK developer
## Product
PersistenceManager and Actions
## Overview
- PersistenceManager should allow to select which parts to save in saveWorkspace, maybe with flags (components/actions/history/mainwindow/viewers...)...## About you
CamiTK developer
## Product
PersistenceManager and Actions
## Overview
- PersistenceManager should allow to select which parts to save in saveWorkspace, maybe with flags (components/actions/history/mainwindow/viewers...)
- Action properties should be loaded without causing a crash: add a flag to Action to say whether they support parameter reloading
- Actions should specify (with a flag) whether they should be replayed (e.g. Mesh Projection: when the workspace is loaded, we want to show again the mesh projections, SmoothingFilter should be re-applied to show smooth meshes)
- Processing scenarios and History support should be added in CamiTK files and saveWorkspace, with a corresponding load function.
- Add an "Export Workspace" that saves the workspace in a directory and "save as" all components in this directory. This avoids the problem of unsaved components when saving a workspace (e.g. with CEP Focus, ultrasound acquisitions can produce many volume images, and the user wants to save everything without entering a filename for each component, so exporting the whole workspace, components included would be useful)
---
**please do not remove anything below this line**Manik BhattacharjeeManik Bhattacharjeehttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/178Pick a point in 3D Viewer, view a 3D cursor2024-01-31T18:55:06+01:00Manik BhattacharjeePick a point in 3D Viewer, view a 3D cursor## About you
CamiTK developer, from multiple users' wishlist.
## Product
Medical Image Viewer, 3D Viewer
## Overview
Currently, the user cannot ctrl+click on a point in the 3D Viewer (except to select a part of a Mesh), and the curre...## About you
CamiTK developer, from multiple users' wishlist.
## Product
Medical Image Viewer, 3D Viewer
## Overview
Currently, the user cannot ctrl+click on a point in the 3D Viewer (except to select a part of a Mesh), and the currently selected point is not visible in the 3D View.
- The users would like to be able to click on an ImageComponent to set the coordinates of a point, like when using Ctrl+Click on 2D Views.
- This should also work on a MeshComponent.
- Showing the position of this point as a 3D cursor (such as a 3D cross) would be a plus.
- Clicking on an Actor could also be used to select components (e.g. clicking on a mesh should select the associated mesh component)
---
**please do not remove anything below this line**https://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/169add dbus connection2023-10-29T13:49:12+01:00Emmanuel Promayonadd dbus connection## About you
CamiTK dev
## Product
CamiTK Core / Application
## Overview
Issue #168 was not detected during configure/make/test as it is not possible to set a test where an application that starts a user interaction loop would be ru...## About you
CamiTK dev
## Product
CamiTK Core / Application
## Overview
Issue #168 was not detected during configure/make/test as it is not possible to set a test where an application that starts a user interaction loop would be run and stopped automatically after a while. For example, in the case of `camitk-fancy` that would have allowed for a simple start and exit. In the presence of a bug similar to #168, the test would then have failed.
A possible way of offering extended testing for application would be to add the possibility for any CamiTK application to listen to dbus messages.
- it would then be possible to send message from outside the application (e.g. a shell, a test script or program...) such as "run action `Quit`".
- it would also add the **great** advantage of opening a whole lot of testing and automation. For instance by sending message analog to state in the action state machine (e.g. by sending XML/json message containing the action to apply and its parameter).
## Relevant logs and/or screenshots
### Adding dbus message support in CamiTK::Application
For instance by using:
```cpp
QDBusConnection::sessionBus().connect(QString(), QString(), "camitk.action", "apply", this, SLOT(applyActionFromDBus(QString)));
...
void Application::applyActionFromDBus(const QString &message) {
if(message=="...") {
...
}
}
```
### From the test application
```cpp
QProcess myProcess;
myProcess.start("camitk-fancy", "");
if (!myProcess.waitForStarted())
return false;
QDBusMessage msg = QDBusMessage::createSignal("/", "camitk.action", "apply");
message="Quit"
QDBusConnection::sessionBus().send(msg);
if (!myProcess.waitForFinished())
return false;
```
**Note**
DBus is supported on Linux desktops by default. A [windows port exists](https://www.freedesktop.org/wiki/Software/dbus/#download) but this need further checks.
### dbus not allowed by default
For security reason, the default behaviour should be _not_ to listen to DBus, and flag `--dbus` should be added to the arguments to enable the feature in the application.
### See also
[KDE doc for creating dbus interface](https://develop.kde.org/docs/features/d-bus/creating_dbus_interfaces/)
---https://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/167ITK Registration Action2023-10-26T16:58:56+02:00Celine FouardITK Registration Action| | |
|--|--|
| **As a** | CamiTK User / Student |
| **I would like to** | Use basic registration technics to align 2 images |
| **So that** | I could visualize registration results directly on CamiTK |
| **Epic/Topics** | Integrate ITK ...| | |
|--|--|
| **As a** | CamiTK User / Student |
| **I would like to** | Use basic registration technics to align 2 images |
| **So that** | I could visualize registration results directly on CamiTK |
| **Epic/Topics** | Integrate ITK Registration into CamiTK |
## Description / Overview
Select mandatory registration parameters on an Action interface. Apply registration
## Acceptance tests
[Please enter acceptance tests as TODOs. Acceptance test explains how to test that this issue is solved]
- [ ] [Test 1]
- [ ] [Test 2]
- [ ] [...]
## Track
[Please keep only one of the following label]
## Misc
- Automatic subscription of issue creator:
**If appropriate, do not forget to mark this issue as "confidential"** by checking the corresponding tick box belowCeline FouardCeline Fouardhttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/166Python bindings: Python CEP and scripting2023-10-13T18:11:11+02:00Manik BhattacharjeePython bindings: Python CEP and scripting## About you
CamiTK developers
## Product
CamiTK
## Overview
Allow Python CEP and Python scripting
---
**please do not remove anything below this line**## About you
CamiTK developers
## Product
CamiTK
## Overview
Allow Python CEP and Python scripting
---
**please do not remove anything below this line**Emmanuel PromayonEmmanuel Promayonhttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/157Reference frames and transformations management2024-03-20T17:31:54+01:00Manik BhattacharjeeReference frames and transformations management| | |
|--|--|
| **As a** | CamiTK developer |
| **I would like to** | support and document reference frames, geometrical transformations and orientation conventions |
| **So that** | CamiTK can load, register and display volumes and mesh...| | |
|--|--|
| **As a** | CamiTK developer |
| **I would like to** | support and document reference frames, geometrical transformations and orientation conventions |
| **So that** | CamiTK can load, register and display volumes and meshes with explicit reference frames, transformations and anatomical orientations |
| **Epic/Topics** | Referential Management Epic |
## Current state overview
**Geometrical transformations in CamiTK are currently managed by**:
- Frames which are attached to all components
- A transformation from each frame to its parent Frame
- A World Frame
- A default orientation for volumes (RAI convention)
- Depending on the file format used (DICOM, MHD/MHA, Nifti...) the transformation to the parent frame may or may not be loaded/saved
- Depending on the file format, the anatomical orientation may be loaded/saved or not, and conversion to RAI may or may not work.
- There is no standard way to store a registration between two images so that CamiTK reloads it when the software loads images again
## Solutions
### 1. Documentation
- Document every detail of geometrical conventions using illustrations when needed to avoid confusion
- For DICOM, there is the position of the patient in the machine, the position of the image relative to the machine, and the convention of the order to save the pixels. [Illustrations are useful](https://dicom.nema.org/medical/Dicom/2016e/output/chtml/part03/sect_C.7.3.html#sect_C.7.3.1.1.2).
- Matrices may be stored in row-major (Nifti) or column-major order (MHA file format)
- For each image and mesh file format, detail how we read and write it (e.g. ITK and VTK do not read and write the same information in the header and do not assume the same conventions for MHA format). This should explain how CamiTK may differ with other software and why we took those decisions.
### 2. Main (core) changes
- Define a CamiTK unique ID : **CamiUID** so that each object has a unique ID, maybe associated with a name, a description and a type ?
- Define a **ReferenceFrame** class (mostly a CamiUID) so that every displayable component has an instance of it
- We have to keep the **anatomical orientation** information. It might be stored in the Referential object and specify which axes (if known) are Right/Left, Superior/Inferior, Anterior/Posterior. This information is transitive (e.g. if there is no large rotation (> 45°) or axes flipping, the anatomical orientation is the same between two reference frames linked by a transformation). It can be set to UNKNOWN (in which case a viewer should not display the anatomical directions).
- Define a **Transformation** class that has an origin and a destination (from/to) ReferenceFrame, a vtkTransform (by default a linear transform represented by a 4x4 matrix), and a CamiUID. Make it generic enough so that it could manage a 4th dimension (e.g. for a time offset between videos) and non-linear transformations
- The Frame interface should be updated
- A Referential and Transformation Manager should be included in CamiTK Application to manage the list of known reference frames and transformations
- In this manager, keep the source of referentials and transformations. E.g. if a Nifti file contains two transforms, the loaded nifti component, when saved, should save again both transforms. and not other transforms to other referentials. Or maybe this information should be stored in the Image Component itself (which transformations to save).
- A CamiTK world referential will exist by default, and components that are loaded without specific transformations to CamiTK will have an identity transform from their referential to CamiTKWorldReferential
- There is no reason to force an orientation convention in CamiTK (e.g. RAI for all volumes).
### 3. UI changes
- An explorer for referential and transformations should be provided, (like the Component explorer, the property explorer and so on). It should be able to display/edit transformations, to link referentials with new transformations (identity, loaded from file...).
- A color code for each referential will be displayed next to each component name, and next to each viewer name, and can be changed by clicking on it to choose another one
### 4. I/O ###
- Define a way to store metadata associated to files (e.g., keep the UID of the referential of a MHD file).
This is linked to a metadata format (see specific issue #158) that should be defined for all CamiTK-related data (such as the LUT settings associated to an image, a list of actions to run for a state machine, a scene description and so on). If possible, choose a human-readable format and try to be compatible with other software or norms, e.g. the JSON format used by [BIDS](https://bids.neuroimaging.io/) or in the metadata files of [Brainvisa](https://brainvisa.info). Maybe a .camitk file.
- test
### 5. Viewers
- Each viewer is attached to a reference frame (e.g. all coordinates of a selected point in the viewer are expressed in this referential), and a camera position and orientation.
- Slice viewers may use their reference frame orientation information to display R/L, A/P, I/S directions
- In viewer preferences, the user can set its own convention (Right displayed on the left, or right displayed on the right)
- When adding a volume to a SliceViewer, it should get its reference frame from it, use anatomical orientation information of the frame, and user preference to orient its camera transform (no need to have RAI/LAS or other convention forced on the volume).
- Viewers should be in charge of the way they want to display a volume (e.g. no Axial View Component, just a SliceViewer with a camera orientation that matches Axial, and a volume image).
- Medical Image Viewer should manage the slices displayed in the 3D view in relation to the slices displayed in the SliceViewers by itself (not using subcomponents)
- A common cursor between viewers can be achieved by following the transformation graph from one view's reference frame to another viewer's reference frame. We can display a 3D cross with its own reference frame, and moving the cursor means changing the transformation between this frame and the selected object's frame. This allows a 3D cursor in a SliceViewer to be displayed in a 3D viewer, rotated with the angle of the slice currently being clicked on.
## Acceptance tests
- [ ] [Documentation is clear and complete]
- [ ] [Reading an image, registering it with another, saving both, then closing the software and reading both again should load all referentials and transforms so that the images are still aligned]
- [ ] [Same test with an image and a mesh segmented from it]
- [ ] [Same test with two meshes registered then saved and loaded again]
- [ ] [3D cursor synchronized between views with different referentials]
- [ ] [Displaying a volume in a SliceViewer using a referential of another volume (should display "arbitrary" slices of the volume aligned with the slices of the other volume)]
- [ ] [Loading two volumes from the same MRI acquisition should show volumes aligned because of the common scanner-based reference]
## Track
## Misc
- Automatic subscription of issue creator:
**If appropriate, do not forget to mark this issue as "confidential"** by checking the corresponding tick box belowManik BhattacharjeeManik Bhattacharjeehttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/152MHA/MHD orientation convention combined with rotation/translation2023-07-28T14:58:20+02:00Manik BhattacharjeeMHA/MHD orientation convention combined with rotation/translation## About you
CamiTK developer
## Overview
This issue is a follow-up of issue #66
When loading and writing MHA/MHD files, geometrical transformations are applied in this order:
- transform to RAI convention
- rotation
- translation
Unf...## About you
CamiTK developer
## Overview
This issue is a follow-up of issue #66
When loading and writing MHA/MHD files, geometrical transformations are applied in this order:
- transform to RAI convention
- rotation
- translation
Unfortunately it means that we apply the rotation and translation specified in the header after changing the convention to RAI (CamiTK convention). But those rotation and translation were probably defined in the convention specified in the header file (e.g. RSA). In that case it means we apply the rotation and translation to the wrong axes.
## Steps to Reproduce
Need sample files in conventions other than RAI to be able to test this.
Finding out which software (3D Slicer ?) uses a different convention to compare how the transform is read/saved in another convention would be useful.
## Actual VS Expected Result
- The transform matrix loaded in a RSA file is saved in an RAI file with the exact same values, even though the axes are not the same
- Loading an image in RSA convention with a translation of (0,1,2) should be saved in RAI with a different translation (1 for axis S-I, 2 for axis A-P)
## Interpretation & Possible fixes
MHA/MHD MetaImage file format specs are not very precise on this issue. But I believe that rotation and translation are defined according to the specified orientation convention, and not an arbitrary one (RAI for CamiTK).
[A thread from 3D slicer](https://discourse.slicer.org/t/bug-when-reading-mha-file-with-anatomicalorientation/7038/7) about how ITK does not use this information correctly and how VTK should manage the issue:
It refers to a [merge request to solve it in VTK that was not merged](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/5656) because it breaks a lot of tests, but the discussion is interesting. [In ITK, it was decided to ignore cases where ITK reader fails](https://github.com/InsightSoftwareConsortium/ITK/issues/1017) because they focus on other image formats.
After reading this we should take our own decision in how to interact with this format.
I suggest:
- read the orientation
- consider the image is encoded in that orientation
- consider the matrix is expressed in the specified orientation and use it accordingly
For the write part, multiple choices:
- we save in any orientation we want (e.g. RAI, current way), specify it in the header, and write the matrix accordingly. The most logical way !
- we save in LPS (used by ITK and other software for MetaImage format), increasing compatibility with other software. We specify the orientation and the matrix in LPS. This would be ok but, there is a problem: it seems that most software just ignore orientation when they read, but use the matrix in their own orientation without adapting it (e.g. 3D Slicer loads the image as LPS, converts to RAS, and considers the matrix as being in RAS...)
## CamiTK Version
CamiTK 5.1.dev.develop.c3d59664
---
**please do not remove anything below this line**Manik BhattacharjeeManik Bhattacharjeehttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/151Picking a point changes selected object and makes current Action disappear2024-03-25T17:54:17+01:00Manik BhattacharjeePicking a point changes selected object and makes current Action disappear## About you
CamiTK developper
## Overview
While creating a CEP, an action that uses multiple components was written and needs to get point coordinates from a click in a viewer.
When clicking on the point, if the image in the viewer is...## About you
CamiTK developper
## Overview
While creating a CEP, an action that uses multiple components was written and needs to get point coordinates from a click in a viewer.
When clicking on the point, if the image in the viewer is not the selected imageComponent, the picking action changes the selection. The action is then hidden because the selection changed.
## Steps to Reproduce
This is visible when using Meniscare CamiTK CEP and the ManualRegistration3D action.
Load two volumes (e.g. brain.mha and sinus-displaced.mha).
In the action, select one of the images, and Ctrl+Click on the image in a slice viewer.
Click on the "pick" button in the action to get the coordinates.
## Actual VS Expected Result
If the image shown in the viewer (the one "selected" in the Action widget) is not the selected component of CamiTK Application, the image is selected, and the action disappears because the component selection changed.
## Interpretation & Possible fixes
This is due to the [selectionChanged(comp)](https://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/blob/develop/sdk/libraries/core/viewer/InteractiveViewer.cpp#L2165) in InteractiveViewer. The same applies to other picking modes in the same InteractiveViewer::picked() function.
I think this is done to show in the PropertyExplorer the coordinates of the picked point when it is clicked (which needs the ImageComponent to be selected), and hiding the action is a side effect of that.
I see two ways to fix this problem:
- do not change the selected component when a point is picked, but that might break the behavior of displaying the picked coordinates in the "selection" tab of the PropertyExplorer
- A large change in CamiTK: separate completely the notion of selected components in the Application with the currently running Action. I mean that when an action is open on selected components, the fact that the selection changes in the application should not hide the action. The action should only be closed if the component disappears (closed) or the action is closed by the user. This means rethinking what an action can be, e.g. an action can be instantiated multiple times, and there should be an ActionExplorer that lists currently opened actions. In this way, we could run the same action twice with different parameters at the same time.
## CamiTK Version
CamiTK 5.1.dev.develop.f3f104d8
---
**please do not remove anything below this line**https://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/142Toolbar for each viewer2023-06-14T08:19:10+02:00Manik BhattacharjeeToolbar for each viewer## About you
CamiTK developer
## Product
IMP UI and Viewers
## Overview
The main toolbar does not apply to all viewers, which is confusing, and does not allow buttons specific to a viewer (e.g. display mode).
Code structure is alread...## About you
CamiTK developer
## Product
IMP UI and Viewers
## Overview
The main toolbar does not apply to all viewers, which is confusing, and does not allow buttons specific to a viewer (e.g. display mode).
Code structure is already developed with viewer-specific toolbars in mind.
---
**please do not remove anything below this line**Manik BhattacharjeeManik Bhattacharjeehttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/141Add icon next to components to show/hide components in viewers2023-11-24T19:10:15+01:00Manik BhattacharjeeAdd icon next to components to show/hide components in viewers## About you
CamiTK developer
## Product
Main IMP interface - Component explorer
## Overview
In the list of components in camitk-imp, it would be useful to have an eye icon next to the component's name to click on to show or hide co...## About you
CamiTK developer
## Product
Main IMP interface - Component explorer
## Overview
In the list of components in camitk-imp, it would be useful to have an eye icon next to the component's name to click on to show or hide components in views.
As visibility depends on the view:
- should we add a ViewerExplorer in IMP that would allow to select views (adding or removing components from views before setting visibility,
- just show/hide on all views ?
- Allow drag and drop of a component into a viewer to make it visible in that viewer.
## Relevant logs and/or screenshots
Eye icons that are already present in CamiTK: sdk/libraries/core/resources/oxygen_icons/actions/layer-visible-on.png
---
**please do not remove anything below this line**Manik BhattacharjeeManik Bhattacharjeehttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/140Better LUT editor, standard LUT should be provided as well2024-03-25T17:37:38+01:00Manik BhattacharjeeBetter LUT editor, standard LUT should be provided as well## About you
CamiTK developer
## Product
sdk/actions/image/imagelut
## Overview
The LUT editor only allows to choose one color (changing the first color does nothing) and go from black to that color.
There is no way to create a LUT t...## About you
CamiTK developer
## Product
sdk/actions/image/imagelut
## Overview
The LUT editor only allows to choose one color (changing the first color does nothing) and go from black to that color.
There is no way to create a LUT that goes from blue to yellow to red for example, and that should be possible.
We should also provide a list of "standard" LUTs, maybe taken from another opensource project (Brainvisa/Anatomist ?).
The same editor could be used for the 3D rendering widget as well if we can also set transparency (RGBA) of the reference values
Saving a user's custom LUTs would be useful too.
To avoid the UI being too complex,
- use one tab to select a palette and set window level and width (adapted to the range of the image type - e.g. 0-65535 for uint16 or -2B/+2B for int32, not 0-255 in all cases)
- use another tab to create a new palette
## Relevant logs and/or screenshots
BrainVisa/Anatomist palette system: https://brainvisa.info/anatomist-5.0/user_doc/anatomist_tutorial.html#modification-of-color-palette
---
**please do not remove anything below this line**Manik BhattacharjeeManik Bhattacharjeehttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/139CamiTK does not read OBJ material file2023-06-05T17:22:36+02:00Manik BhattacharjeeCamiTK does not read OBJ material file## About you
CamiTK developer
## Product
sdk/obj/ObjComponent
## Overview
The OBJ file format can be associated with a .mtl file that store the material (RGBA color). This is ignored by CamiTK.
## Relevant logs and/or screenshots
V...## About you
CamiTK developer
## Product
sdk/obj/ObjComponent
## Overview
The OBJ file format can be associated with a .mtl file that store the material (RGBA color). This is ignored by CamiTK.
## Relevant logs and/or screenshots
VTK has two objects to read obj files: CamiTK should use VtkObjImporter (and not VtkObjReader) and use its support for mtl files.
A test object can be easily generated in Blender (standard cube + material exported as obj file).
---
**please do not remove anything below this line**Manik BhattacharjeeManik Bhattacharjeehttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/138Add support for RGBA color2023-06-05T17:16:25+02:00Manik BhattacharjeeAdd support for RGBA color## About you
CamiTK developer
## Product
MeshComponent
## Overview
MeshComponent can have associated data. If the display mode is COLOR, the data is read as RGB data.
If there is a 4th dimension (A for alpha transparency), this is no...## About you
CamiTK developer
## Product
MeshComponent
## Overview
MeshComponent can have associated data. If the display mode is COLOR, the data is read as RGB data.
If there is a 4th dimension (A for alpha transparency), this is not supported.
It should be checked whether data works if it is encoded as:
- double/float between 0 and 1,
- int 8/16/32 bits in their respective range
## Relevant logs and/or screenshots
Check commit d827e23daf036652c10657bd57f12d0819ba0891
In libraries/core/mesh/MeshComponent.cpp
`colorArrayToDisplay->SetTuple3(i, val[0], val[1], val[2]);`
should work when there are 4 values with setTuple4. Hopefully VTK would use that as RGBA.
---
**please do not remove anything below this line**Manik BhattacharjeeManik Bhattacharjeehttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/137Unix file separator "/" is used explicitely in some file handling code of the...2023-05-31T12:15:49+02:00Manik BhattacharjeeUnix file separator "/" is used explicitely in some file handling code of the SDK instead of a portable value such as QDir::separator()## About you
CamiTK developper
## Overview
While reading code in libraries/core/viewer/RendererWidget.cpp I found a line of code which assumes that file path are using the unix separator '/'.
```c++
QString filePrefix = QFileInfo(filen...## About you
CamiTK developper
## Overview
While reading code in libraries/core/viewer/RendererWidget.cpp I found a line of code which assumes that file path are using the unix separator '/'.
```c++
QString filePrefix = QFileInfo(filename).absolutePath() + "/" + QFileInfo(filename).baseName();
```
The same type of separator use is found at multiple places in the SDK:
```bash
$ grep -n --include "*.cpp" --include "*.h" '"/"' * -R
```
```c++
actions/application/file/SaveAsAction.cpp:178: QFileDialog saveFileDialog(nullptr, tr("Save File As..."), QFileInfo(compfileName).dir().canonicalPath() + "/" + suggestedName, test);
actions/application/file/SaveAsAction.cpp:183: QString filename = QFileDialog::getSaveFileName(nullptr, tr("Save File As..."), QFileInfo(compfileName).dir().canonicalPath() + "/" + suggestedName, test);
applications/actionstatemachine/SaveActionState.cpp:107: (*outIt)->setFileName(saveDirName + "/" + compName + ".mha");
applications/actionstatemachine/SaveActionState.cpp:109: (*compIt)->setFileName(compDir + "/" + compName + compExt);
applications/actionstatemachine/SaveActionState.cpp:114: (*logStream) << compDir + "/" + compName + compExt << "' type='" << compType << "'/>" << Qt::endl;
applications/testcomponents/main.cpp:190: comp->setFileName(outputDirectory + "/" + inputComponent.fileName());
applications/wizard/GeneratingCEPState.cpp:105: QString outputFileName = dir.absolutePath() + "/" + cepDirName + "/libraries/" + libraryName + "/" + shortFileName;
components/vtkimage/VtkImageComponentExtension.cpp:251: QString filePattern = fileInfo.absoluteDir().absolutePath() + "/" + fileInfo.baseName();
components/off/OffExtension.cpp:71: QString baseFilename = QFileInfo(component->getFileName()).absolutePath() + "/" + QFileInfo(component->getFileName()).completeBaseName();
components/obj/ObjExtension.cpp:68: QString baseFilename = QFileInfo(component->getFileName()).absolutePath() + "/" + QFileInfo(component->getFileName()).completeBaseName();
libraries/core/viewer/RendererWidget.cpp:572: QString filePrefix = QFileInfo(filename).absolutePath() + "/" + QFileInfo(filename).baseName();
libraries/core/utils/CamiTKLogger.cpp:158: QFile::rename(fileToMove.absoluteFilePath(), logFileDirectory.path() + "/" + logFileName);
libraries/core/utils/CamiTKLogger.cpp:162: logFile = new QFile(logFileDirectory.path() + "/" + logFileName);
libraries/core/ExtensionManager.cpp:322: QString privateLibToLoad = Core::getGlobalInstallDir() + "/" + QString(Core::libDir) + "/" + QString(Core::shortVersion) + "/" + libname.cap(1);
libraries/core/ExtensionManager.cpp:328: privateLibToLoad = Core::getGlobalInstallDir() + "/" + QString(Core::libDir) + "/" + QString(Core::shortVersion) + "/" + libname.cap(1);
libraries/core/ExtensionManager.cpp:367: // add one cdUp() for each "/" inside Core::libDir (to take into account any multiarch configuration that
libraries/core/ExtensionManager.cpp:576: appFilePath.replace("/", "\\");
libraries/core/ExtensionManager.cpp:717: if (potentialPath.cd(potentialLibDir + "/" + QString(Core::shortVersion))) {
libraries/core/Core.cpp:314: QStringList installDirectories = getInstallDirectories(QString(Core::libDir) + "/" + QString(Core::shortVersion) + "/" + extensionType);
libraries/core/Core.cpp:318: QStringList libInstallDirectories = getInstallDirectories("lib/" + QString(Core::shortVersion) + "/" + extensionType, false);
libraries/cepgenerator/CepGenerator.cpp:95: devDirectoryName = devDirectoryName + "/";
libraries/cepgenerator/ComponentExtensionGenerator.cpp:309: QString testFileName = currentDirectory.absolutePath() + "/" + "empty." + suffix;
```
Same with '/':
```cpp
libraries/core/ExtensionManager.cpp:369: for (int i = 0; i < QString(Core::libDir).count(QLatin1Char('/')); i++) {
components/vtkmesh/VtkMeshUtil.cpp:230: size_t nbegin = vtkFileName.find_last_of('/');
```
Outside the SDK, tutorials and modeling also contain instances of the same problem:
```cpp
modeling/libraries/mml/monitoring/MonitoringManager.cpp:565: if (mmlIn->simulatorFile().get()[0] != '/') {
modeling/libraries/mml/monitoring/AnsysSimulator.cpp:48: if (workingDir[workingDir.length() - 1] != '/') {
modeling/libraries/mml/monitoring/ArtiSynthSimulator.cpp:44: if (workingDir[workingDir.length() - 1] != '/') {
modeling/applications/pmltools/obj2pml/obj2pml.cpp:111: unsigned int slash = buff.find('/');
modeling/actions/mml/GenerateModel.cpp:86: QString baseFilename = QFileInfo(originalFilename).absolutePath() + "/" + QFileInfo(originalFilename).completeBaseName();
modeling/libraries/mml/monitoring/MonitoringManager.cpp:53: size_t slashPlace = mmlPath.find_last_of("/");
modeling/libraries/mml/monitoring/MonitoringManager.cpp:97: QString guessPMLFilename = QFileInfo(fi).absolutePath() + "/" + QFileInfo(fi).baseName() + ".pml";
modeling/libraries/mml/monitoring/SofaSimulator.cpp:80: QString scnFileName = mmlFileInfo.absolutePath() + "/" + mmlFileInfo.baseName() + ".scn";
modeling/libraries/mml/monitoring/SofaSimulator.cpp:88: scnFileName = QDir::tempPath() + "/" + mmlFileInfo.baseName() + ".scn";
modeling/libraries/mml/monitoring/SofaSimulator.cpp:92: QString mshFileName = QDir::tempPath() + "/" + QFileInfo(monitoringManager->getPmlFileName().c_str()).baseName() + ".msh";
modeling/libraries/mml/monitoring/SofaWidget.cpp:87: size_t slashPlace = scnFileTemp.find_last_of("/");
modeling/libraries/mml/monitoring/AnsysSimulator.cpp:49: workingDir = workingDir + "/";
modeling/libraries/mml/monitoring/ArtiSynthSimulator.cpp:45: workingDir = workingDir + "/";
modeling/libraries/mml/monitoring/Reference.cpp:82: size_t slashPlace = refpath.find_last_of("/");
modeling/components/mmlcomponent/MMLComponent.cpp:61: file = QDir::tempPath() + "/" + QFileInfo(fi).baseName() + ".mml";
modeling/applications/pmltools/extractCells/extractCells.cpp:147: extracted = new StructuralComponent(pm, c1 + "/" + c2 + " extracted");
modeling/applications/pmltools/extractCells/extractCells.cpp:172: cout << '\r' << (i + 1) << "/" << ok;
modeling/applications/pmltools/extractCells/extractCells.cpp:192: pm->setName(pm->getName() + " " + c1 + "/" + c2 + " Extracted");
```
```cpp
tutorials/components/mixed/MixedComponent.cpp:41: QString mhaFile = QFileInfo(file).absolutePath() + "/" + filename.c_str();
tutorials/components/mixed/MixedComponent.cpp:43: QString vtkFile = QFileInfo(file).absolutePath() + "/" + filename.c_str();
tutorials/applications/fancy/FancyMainWindow.cpp:221: ui.slideValue->setText(QString("%1").arg((currentSliceId + 1), 3) + "/" + QString("%1").arg(maxSliceId, 3));
tutorials/applications/nogui/main.cpp:85: QString outputFileName = QDir::currentPath() + "/" + QFileInfo(image->getFileName()).completeBaseName() + "-output." + QFileInfo(image->getFileName()).suffix(
```
## Actual VS Expected Result
As CamiTK is multiplaform, the code should not assume that the path separator is the '/' char.
Using Qt Resources might be an exception to this, so each line of code should be checked manually before replacing '/' by QDir::separator().
## Interpretation & Possible fixes
Replacing '/' char with QDir::separator() when building file paths.
## CamiTK Version
CamiTK 5.1.dev.develop.f3f104d8
---
**please do not remove anything below this line**Manik BhattacharjeeManik Bhattacharjeehttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/132Option to highlight selected object by silhouette2023-04-21T19:56:41+02:00Manik BhattacharjeeOption to highlight selected object by silhouette## About you
CamiTK developer
## Product
Core in InteractiveViewer.
## Overview
In the main viewer, unselected elements are transparent, selected elements are not.
Add an option to show unselected elements as non-transparent, and selec...## About you
CamiTK developer
## Product
Core in InteractiveViewer.
## Overview
In the main viewer, unselected elements are transparent, selected elements are not.
Add an option to show unselected elements as non-transparent, and selected elements with an highlighted sihouette.
This is identical to [the VTK Silhouette example](https://kitware.github.io/vtk-examples/site/Cxx/Picking/HighlightWithSilhouette/)
---
**please do not remove anything below this line**Manik BhattacharjeeManik Bhattacharjeehttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/126Name conflict while including external lib using QT for a CEP action2023-02-23T18:05:42+01:00Erwan LecesneName conflict while including external lib using QT for a CEP actionThe CmakeLists is located **_../actions/MyAction/CmakeLists.txt_** . [Cmake_output.txt](/uploads/4dbc62aefa9a879f9065beb3a65c0061/Cmake_output.txt)[CmakeLists.txt](/uploads/5611751a71ec3746480b7bde59091bec/CmakeLists.txt)The CmakeLists is located **_../actions/MyAction/CmakeLists.txt_** . [Cmake_output.txt](/uploads/4dbc62aefa9a879f9065beb3a65c0061/Cmake_output.txt)[CmakeLists.txt](/uploads/5611751a71ec3746480b7bde59091bec/CmakeLists.txt)