CamiTK Community Edition issueshttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues2024-02-16T10:08:32+01:00https://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/156CamiTK Release Management2024-02-16T10:08:32+01:00Emmanuel PromayonCamiTK Release Management| | |
|--|--|
| **As a** | CamiTK developer |
| **I would like to** | Release new CamiTK version |
| **So that** | A new stable version is available to users and ready to be packaged in Debian |
## Description / Overview
This issue i...| | |
|--|--|
| **As a** | CamiTK developer |
| **I would like to** | Release new CamiTK version |
| **So that** | A new stable version is available to users and ready to be packaged in Debian |
## Description / Overview
This issue is meant to be reused for each release, it is a direct translation of an internal document with the list of task to carry out for each release. It might be a bit technical for non CamiTK developer, but the targeted audience is only the maintainers (although remarks and suggestions are always welcomed!)
## Forewords
A release:
- cannot have blocking bugs
- must have no compilation error on supported platforms and no failed test on CDash
Normally all these requirements should be match thanks to the git branching model, the agile process and the continuous integration system.
Some extra steps are recommended here in order to improve the quality of the release, reduce technological debt along the way, _and_ ensure a smoother debian packaging process.
## Steps
This is the detailed procedure of each step. Tick the corresponding task below when a step is achieved.
### Step 1. Create a release management MR
To do so:
- Re-open this issue
- Create a corresponding branch + merge request but _change the default name_ to `camitk-x.y-release-management`
### Step 2. Prepare the environment
This step installs the Debian sid image and prepare everything needed to check the current develop branch.
You need to have docker installed, if you do not:
```bash
# Install docker package
sudo apt install docker.io
# Add yourself to the docker group
sudo usermod -aG docker $(whoami)
# log in a different terminal to be in the docker group
```
```bash
# set the version
export version="x.y"
# build the docker image
git clone git@gricad-gitlab.univ-grenoble-alpes.fr:CamiTK/camitk-docker.git
cd camitk-docker
docker build --rm -t camitk:unstable-release-test unstable-release-test
# create the docker network to have static ip for container
docker network create --subnet=172.20.0.0/16 camitk-docker-subnet
# create the homedir with the code
cd where/you/want/to/work
export workspace=$PWD
cd $workspace
git clone git@gricad-gitlab.univ-grenoble-alpes.fr:CamiTK/CamiTK.git -b camitk-$version-release-management src
# create the "permanent" container
# ⚠ the docker image is built for user id/group id 1000:1000
# use --user "$(id -u):$(id -g)" if your id/group id is not 1000:1000
docker container run \
--privileged=true \
--net camitk-docker-subnet \
--ip 172.20.0.33 \
--name camitk-release-$version \
--restart unless-stopped \
-d \
--ipc=host \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $workspace:/home/camitk/workspace \
-w /home/camitk/workspace \
-ti camitk:unstable-release-test
# get inside the docker
docker container exec -it camitk-release-$version bash
```
### Step 3. Fix clang tidy warnings
(or some of them)
```bash
# Note: add -G Ninja to use ninja build system
cmake -S src -B build -DCEP_IMAGING:BOOL=TRUE -DCEP_MODELING:BOOL=TRUE -DCEP_TUTORIALS:BOOL=TRUE -DAPIDOC_SDK:BOOL=TRUE -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja
cmake --build build -j20
run-clang-tidy -header-filter='src/**/.*' -p=build -export-fixes build/clang-tidy-fixes-$(date +"%m-%d-%H:%M") 2>&1 | tee build/clang-error-$(date +"%m-%d-%H:%M").log
```
It is recommended to fix "invoking virtual functions from constructors or destructors", using one of the following three solutions
- solution 1: When methods are private, just remove the unjustified virtual keyword
- solution 2: declare virtual method called in constructor as final, see [OOP50-CPP-EX2 of SEI CERT C++ Coding Standard](https://wiki.sei.cmu.edu/confluence/display/cplusplus/OOP50-CPP.+Do+not+invoke+virtual+functions+from+constructors+or+destructors)
- solution 3: call the virtual function with an explicitly qualified ID (e.g, Application::eventFilter), see OOP50-CPP-EX1 of SEI CERT C++ Coding Standard as well
Leave qtpropertybrowser source code intact to facilitate keeping it sync with other forks.
Note that sometimes the "Potential memory leak" warning should not be fixed (e.g, `new QEvent(...)` are used in `Application`, `InteractiveViewer`, `ActionState` are used to force updates)
### Step 4. Fix clang compiler warnings
```bash
rm -rf build
cmake -S src -B build -DCEP_IMAGING:BOOL=TRUE -DCEP_MODELING:BOOL=TRUE -DCEP_TUTORIALS:BOOL=TRUE -DAPIDOC_SDK:BOOL=TRUE -DCMAKE_CXX_COMPILER=$(which clang++) -DCMAKE_C_COMPILER=$(which clang) -G Ninja
cmake --build build -j20
```
### Step 5. Fix source code format using astyle
Run the following to reformat all code (see CamiTK Programming Guidelines):
```bash
cd src
astyle --style=java \
--break-closing-brackets \
--add-brackets \
--unpad-paren \
--pad-oper \
--pad-header \
--align-pointer=type \
--indent-switches \
--suffix=none \
$(find . -name "*.cpp" -or -name "*.h")
```
### Step 6. Update source code comment with the current year
To check the file that have to be updated if last release was done in 20xx:
```bash
# Get the last tag and extract its year using git
lastReleaseYear=$(git show --format=%ai $(git describe --tags $(git rev-list --tags --max-count=1)) | cut -d ' ' -f 1 | cut -d '-' -f 1 | tail -2 | head -1)
grep -rH "2001-$lastReleaseYear"
```
To update all files to release in 20yy:
```bash
# update
newReleaseYear=$(date +"%Y")
if [ "$newReleaseYear" != "$lastReleaseYear" ]; then
filesToUpdate=$(grep -rHl "2001-$lastReleaseYear")
for i in $filesToUpdate ; do
sed -i "s/(c) 2001-$lastReleaseYear Univ/(c) 2001-$newReleaseYear Univ/g" $i;
done
fi
```
### Step 7. Update packaging
**warning:** That's probably the hardest of all steps!
```bash
cd ..
rm -rf build
sudo apt update
sudo apt upgrade
PROJECT_LOG_DIR=log bash src/.gitlab/package.sh
```
Process
1. execute this script a first time, and then you can work on the debian/ directory
2. if the package is not produced:
- prepare release CamiTKVersion.h and recreate orig
- `cd src` (that's where camitk-x.y-release-management branch sits)
- `cmake -S . -B build -DCEP_IMAGING:BOOL=TRUE -DCEP_MODELING:BOOL=TRUE -DCEP_TUTORIALS:BOOL=TRUE -DAPIDOC_SDK:BOOL=TRUE`
- edit `./build/sdk/libraries/core/CamiTKVersion.h` so that `Core::version` is equal to `CamiTK ${version}.0` **exactly**
- `cp ./build/sdk/libraries/core/CamiTKVersion.h ../camitk-debian/sdk/libraries/core/`
- check autopkgtest files in `../camitk-debian/debian/tests/*.sh` : `cepgenerator-test.sh` `config-test.sh` `generate-coreschema-files.sh` and `generate-cpp-files.sh`
- if any change were done on debian git and not integrated upstream, merge with corresponding files in `sdk/applications/config/testing` and `sdk/applications/cepgenerator/testing`
- then copy the new versions to `camitk-debian/debian/tests`:
- `cp sdk/applications/config/testing/config-test.sh sdk/applications/cepgenerator/testing/*.sh ../camitk-debian/debian/tests/`
- `cd ../camitk-debian`
- `dpkg-source --commit`
This creates a `debian/patches` file that contains the addition of the generated `CamiTKVersion.h`.
⚠ Do not push back this to salsa.
_BEWARE_ : this specific patch SHOULD NOT be commited back to salsa. As this patch is now listed
in `debian/patches/series` it will be automatically applied during the package build.
(TODO find a better way to include CamiTKVersion.h before first tarball is produced)
- fiddle with the debian/ files, start with:
- check the packaging after a change with:
```bash
{ time gbp buildpackage \
--git-no-create-orig \
--git-ignore-new \
--git-postbuild='~/.gbp-postbuild.sh' 2>&1 ; } 2>&1
```
This produces two logs:
- build log: camitk_version_amd64.build
- dependencies list: camitk_version_amd64.buildinfo
**Note** if things have to be modifid in the CamiTK source code, report all modification to the camitk-x.y-release-management branch
- back to fiddling if it did not work
- commit the changes and push to salsa
When everything looks good, create a new docker from naked sid and run the autotest from the `camitk-debian` directory:
```bash
docker run -v.:/home/camitk/workspace -ti debian:sid bash
# in docker container
cd /home/camitk/workspace
apt update
apt install -y autopkgtest
autopkgtest -l autopkgtest-sid.log camitk_5.1.202307271147-1_amd64.changes -- null
```
### Step 8. Merge release management branch in develop
Now that this branch is merge to develop, it is time to create the actual new release.
See the `Release New Version.md` document on the CamiTK developer cloud.
## Tasks (see corresponding step)
- [ ] 1\. Create a release management MR
- [ ] 2\. Prepare the environment
- [ ] 3\. Fix clang tidy warnings
- [ ] 4\. Fix clang compiler warnings
- [ ] 5\. Fix source code format using astyle
- [ ] 6\. Update source code comment with the current year
- [ ] 7\. Update packaging
- [ ] 8\. Merge release management branch in develop
## TODO
The following TODO list requires attention so that they can more reproducible / systematically applied. They should be worked on and then added to the previous steps as a release management step in their full right.
### Packaging should use `camitk-${version}-release-management` tarball
Script `.gitlab/package.sh` uses the current `develop` branch tarball to test the packaging. It should use the current state of `camitk-${version}-release-management` instead, as this branch is closer to the release branch than develop.
### Fix clazy warnings (or some of them)
[(see this list for details](https://github.com/KDE/clazy#list-of-checks). It is recommended to fix: fully-qualified-moc-types, qstring-args, qenums and most (but not all as there was some false positive or some that required more complete rewrite)container-anti-pattern and range-loop. Note that: non-pod-global-static, connect-3arg-lambda, qtpropertybrowser and source code generated by xsdcxx are not recommended.
[see this video to set it up](https://www.youtube.com/watch?v=c0ie0xww7SA)
### Fix cppcheck warnings (or some of them)
cppcheck can be ran with `--enable=performance --enable=portability --library=qt -i ./CMakeFiles`
It is recommended to fix for instance:
- (performance) Prefer prefix ++/-- operators for non-primitive types.
- (performance) Variable assigned in constructor body moved to initialization list.
The "(performance) Function parameter 'xxx' should be passed by const reference" should not be change (at this stage anyway) as it will change the API
[see this page for an example of set up](https://arcanis.me/en/2015/10/17/cppcheck-and-clang-format)
### Memory leak
A systematic recommended way to check memory leak is to use [heaptrack](https://github.com/KDE/heaptrack) on Linux.
An easy way to do this for CamiTK is to run the itkfilter integration test (or any other integration tests).
<div>
You can list all integration tests with `ctest -N | grep integration`
You can get the line that is executed by a test by adding `-VV` to ctest e.g. `ctest -VV -R action-itkfilters-integration-test`
</div>For instance to check memory leaks with `action-itkfilters-integration-test`:
```bash
heaptrack bin/camitk-actionstatemachine -f /home/promayon/Dev/CamiTK/build/camitk/Testing/Temporary/action-itkfilters-integration-test/asm-input.scxml -o /home/promayon/Dev/CamiTK/build/camitk/Testing/Temporary/action-itkfilters-integration-test -a
```
View and check the resulting `gz` file using heaptrack_gui
### generate new API documentation
Test and generate new API documentation with doxygen and update doxyfile accordingly → set `APIDOC_SDK` option in `CMake` configure to `TRUE`, run target `camitk-ce-api-doc`
### Test deployment on windows
- Create the user archive (see [script in Appendix 1](#appendix-create-windows-install-archive))
- test the user archive on a bare windows machineManik BhattacharjeeManik Bhattacharjee2024-02-06https://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/127Support of ITK5 on debian2022-11-20T10:08:49+01:00Emmanuel PromayonSupport of ITK5 on debian## About you
CamiTK developer
## Product
camitk community edition
## Overview
debian got rid of itk4, and will only support itk5 from now on.
Next ubuntu LTS has a debian freeze on February 24
## Challenge
get camitk5 back into un...## About you
CamiTK developer
## Product
camitk community edition
## Overview
debian got rid of itk4, and will only support itk5 from now on.
Next ubuntu LTS has a debian freeze on February 24
## Challenge
get camitk5 back into unstable and therefore support ITK5 and all new sid niceties and updates...Emmanuel PromayonEmmanuel Promayon2022-02-14https://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/87Bug library installation path2019-08-03T17:34:37+02:00Clement BeitoneBug library installation path## About you
Clément Beitone (TIMC-GMCAO) working on a cep that use other ceps
## Overview
It seems that a bug is hidden somewhere inside the cmake install path.
Whenever I install a cep that contains a library, the library install pa...## About you
Clément Beitone (TIMC-GMCAO) working on a cep that use other ceps
## Overview
It seems that a bug is hidden somewhere inside the cmake install path.
Whenever I install a cep that contains a library, the library install path which should be something like:
`/usr/local/include/camitk-4.2/libraries/devicelibrary/**libname**`
appears to be:
`/usr/local/include/camitk-4.2/libraries/**devicelibrary/devicelibrary**`
## Steps to Reproduce
make a manual global installation of any cep that contains at least a library in the folder libraries
## CamiTK Version
- CamiTK version........................... CamiTK 4.2.dev.develop.2eaece56
- CamiTK Short Version..................... camitk-4.2
- CamiTK SO NAME........................... 4
- Operating System......................... LINUX
- Build type............................... RELEASE
- QT Version............................... 5.11.3
- VTK Version.............................. 7.1.1
- Global Installation Directory [G]........ /usr/local
- Local Installation Directory [L]......... /home/beitoncl/.config/CamiTK
- Current Working Directory [W]............ /home/beitoncl/Documents/Dev/calibrationPolaris/calibrationcep/build
- Test Data Directory...................... /home/beitoncl/Documents/Dev/calibrationPolaris/calibrationcep/build/share/camitk-4.2/testdata
- Component Extension Directories.......... /home/beitoncl/Documents/Dev/calibrationPolaris/calibrationcep/build/lib/camitk-4.2/components
/usr/local/lib/camitk-4.2/components
- Action Extension Directories............. /home/beitoncl/Documents/Dev/calibrationPolaris/calibrationcep/build/lib/camitk-4.2/actions
/usr/local/lib/camitk-4.2/actions
- Number of Component Extensions........... 13 (locations: 12 global, 0 local, 1 in working directory, 0 manually installed by user)
- Number of File Extensions Supported...... 25
- Number of Action Extensions.............. 19 (locations: 18 global, 0 local, 1 in working directory, 0 manually installed by user)
- Number of Actions........................ 98
- Registered components:
- [G] Alias Wavefront OBJ Component...... obj
- [W] CalibrationComponentExtension...... calib
- [G] Device Component Extension......... device
- [G] FocusImageComponentExtension....... fia
- [G] Msh Component...................... msh
- [G] Off Component...................... off
- [G] STL Component...................... stl, STL
- [G] TrackerComponentExtension.......... tbuf
- [G] USImageComponentExtension.......... usi
- [G] USStreamComponentExtension......... uss
- [G] VRML 2 Component................... vrml, wrl
- [G] VTK Component...................... vtk
- [G] vtkImages Component................ jpg, png, tiff, tif, bmp, pbm, pgm, ppm, mhd, mha, raw
- Registered actions:
- [G] Application Level Actions.......... 21 actions
- [G] Basic Mesh Extension............... 9 actions
- [G] Basic Topology..................... 2 actions
- [G] BoxVOIExtension.................... 1 actions
- [W] CalibrationActionExtension......... 2 actions
- [G] Device Action Extension............ 6 actions
- [G] FocusActionExtension............... 1 actions
- [G] Frame Edition Extension............ 1 actions
- [G] Image LUT.......................... 1 actions
- [G] ImageAcquisitionActionExtension.... 7 actions
- [G] Mesh Processing.................... 17 actions
- [G] MultiPickingExtension.............. 1 actions
- [G] Pixel Color Changer................ 1 actions
- [G] ReconstructionExtension............ 1 actions
- [G] Reorient Image Extension........... 1 actions
- [G] ResampleExtension.................. 1 actions
- [G] ShowIn3DExtension.................. 5 actions
- [G] TrackerActionExtension............. 19 actions
- [G] VolumeRenderingExtension........... 1 actions
---
**please do not remove anything below this line**Emmanuel PromayonEmmanuel Promayon2019-08-02https://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/177Save All fails if a Component does not have a filename (e.g. newly reconstruc...2024-02-07T12:35:39+01:00Manik BhattacharjeeSave All fails if a Component does not have a filename (e.g. newly reconstructed mesh)## About you
CamiTK developer
## Overview
SaveAll implementation is wrong and fails in multiple ways when components to save do not have a filename. This can lead to data loss (thinking a file was saved even it was not) and segfault (w...## About you
CamiTK developer
## Overview
SaveAll implementation is wrong and fails in multiple ways when components to save do not have a filename. This can lead to data loss (thinking a file was saved even it was not) and segfault (when no component is selected).
## Steps to Reproduce
Open two masks (e.g. skull-binary.stl and head-binary from testdata).
Using action Reconstruction to create a mesh from each mask.
- Scenario 1
- Select both meshes
- Click on "Save All" from the File menu
- In the first Save As window, save as Mesh1.obj
- In the second window, save as Mesh2.obj
- Scenario 2
- Deselect all components
- Click on "Save All" from the File menu
## Actual VS Expected Result
- Scenario 1
- Expected: both meshes are saved in their own file, each now has a filename set to the one that was used to save them
- Actual: only one of the meshes was saved in both files. This mesh now has a filename set to the latest file saved. The other mesh is ignored and not saved
- Scenario 2
- Expected: both meshes are saved in their own file
- Actual result: CamiTK crashes, all work is lost
## Interpretation & Possible fixes
- `SaveAllAction::apply` calls `Application::save` on all top-level components.
- `Application::save` checks if the filename is empty. If it is, it calls
- `getAction("Save As")->apply()`.
The problem here is that the `SaveAsAction::apply` function does not know which component it must save, as this is not a parameter of `apply`.
It will try to save the last selected component, which is probably not the one we are trying to save.
`Component* comp = Application::getSelectedComponents().last();`
If there is no selected component (Scenario 2), this tries to get a Component from an empty list and crashes (qt_assert in debug mode).
If there is at least a selected component, SaveAll will save the last selected component over and over again.
**To fix this**
Modify action "Save As" so we can set a componentToSave parameter, apply it, then reset ComponentToSave to null_ptr. Apply would then check for this parameter, revert to the current behaviour if it is empty, and check if there are selectedComponents before getting the last element.
## CamiTK Version
CamiTK 5.2.0.158-camitk-file-format-metadata-scenes-processing-scenarios.c46342cd
---
**please do not remove anything below this line**Manik BhattacharjeeManik Bhattacharjeehttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/176Triggering the Arbitrary Slice action crashes with 2D images2023-12-22T23:07:35+01:00Emmanuel PromayonTriggering the Arbitrary Slice action crashes with 2D images## About you
CamiTK developer
## Overview
When triggering the "Arbitrary Slice" on an image component that contains a 2D image, the application crashes.
## Steps to Reproduce
Save [this image](/uploads/43c877105d9b1b7d3fd67d85088016...## About you
CamiTK developer
## Overview
When triggering the "Arbitrary Slice" on an image component that contains a 2D image, the application crashes.
## Steps to Reproduce
Save [this image](/uploads/43c877105d9b1b7d3fd67d85088016b0/debian-logo.png) and open it with `camitk-imp`
Select the component, and select the `View` → `Arbitrary Slice`
→ `camitk-imp` crashes
## Actual VS Expected Result
No crash !
The arbitrary slice action should abort cleanly and a warning message should be displayed to explain why the action aborted.
## Interpretation & Possible fixes
The arbitrary slice's `SingleImageComponent` is only created if the image component has 3 dimensions (see ImageComponent.cpp:562 and line 571. When the arbitrary slice action is triggered it does not take into account the fact that an `ImageComponent` can have no arbitrary slice subcomponent.
Check the pointer value before accessing it (see AnglesAndTranslationAction::getWidget(), line 106).
## CamiTK Version
CamiTK 5.2.0.develop. 54c95fce
---
**please do not remove anything below this line**https://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/175Add "Delete" key shortcut to close the currently selected component2023-12-15T14:10:00+01:00Emmanuel PromayonAdd "Delete" key shortcut to close the currently selected componenthttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/174Generic user interface improvements2023-12-08T23:29:36+01:00Emmanuel PromayonGeneric user interface improvements## About you
CamiTK developer that listen to my users
## Overview
This issue covers all small UI improvements.## About you
CamiTK developer that listen to my users
## Overview
This issue covers all small UI improvements.https://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/173In Action viewer's search panel, the Family combo box does not filter actions2023-11-29T14:58:33+01:00Manik BhattacharjeeIn Action viewer's search panel, the Family combo box does not filter actions## About you
CamiTK developer
## Overview
In the action viewer, the "Family" combo box does nothing.
## Steps to Reproduce
- from a newly built CamiTK, run camitk-imp
- open testdata/sinus-displaced.mha
- In the menu click on View/To...## About you
CamiTK developer
## Overview
In the action viewer, the "Family" combo box does nothing.
## Steps to Reproduce
- from a newly built CamiTK, run camitk-imp
- open testdata/sinus-displaced.mha
- In the menu click on View/Toggle Docked Viewers/Action Viewer to show the Action viewer panel
- Select the component
- Click on the Action combobox in the actions panel and see the list of available actions
- Select a Family e.g. Frame
- Click on the Action combobox, all actions are still there
## Actual VS Expected Result
All actions are visible, nor only the actions from the selected family.
## Interpretation & Possible fixes
This bug was introduced by commit 1bdd9a84 with a change to ImpMainWindow.cpp around line 111.
The line
`actionViewer->setSearchPanelVisible(true);`
was removed.
We could either restore this line (and the necessary dynamic_cast to ActionViewer) or call it from the ActionViewer constructor.
I am not certain why setSearchPanelVisible should disconnect the link from the combobox'signals to the relevant methods.
## CamiTK Version
CamiTK 5.2.0.157-reference-frames-and-transformations-management.a9f78af5
---
**please do not remove anything below this line**Manik BhattacharjeeManik Bhattacharjeehttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/172On Windows, CamiTK applications may block or wait indefinitely2023-11-27T15:47:09+01:00Manik BhattacharjeeOn Windows, CamiTK applications may block or wait indefinitely## About you
CamiTK developer, reported by two windows users
## Overview
After a crash, and even after reinstalling CamiTK, camitk-imp does not open or takes a very long time (several minutes) before opening. camitk-config can display ...## About you
CamiTK developer, reported by two windows users
## Overview
After a crash, and even after reinstalling CamiTK, camitk-imp does not open or takes a very long time (several minutes) before opening. camitk-config can display paths, but will not return for a very long time, or display a locking timeout in a command window.
## Steps to Reproduce
Not obvious. It seems to involve .lock or .rmlock files in %username%/AppData/Roaming/CamiTK directory.
Removing the entire directory seems to fix it.
## Actual VS Expected Result
Expected: camitk-imp starts in a few seconds (not minutes), and camitk-config returns less than a second after displaying the info (not minutes).
## Relevant logs and/or screenshots
A Qt message is sometimes displayed in a loop in a terminal while camitk-config is waiting to exit (data already displayed, but the software is not exiting): "Got unexpected locking error 123"
## Interpretation & Possible fixes
Not obvious. It seems that in some circumstances, in the %username%/AppData/Roaming/CamiTK directory, some lock files are present and Qt tries to lock settings files but fails to do so. It might also come from a conflict between camitk-config and camitk-imp trying to access the file at the same time.
This stems from the Application class creating a QSettings object in Application.cpp (global static object):
`QSettings Application::settings(QSettings::IniFormat, QSettings::UserScope, "CamiTK", QString(Core::version).remove(QChar(' ')));`
From [Qt documentation](https://doc.qt.io/qt-6/qsettings.html#accessing-settings-from-multiple-threads-or-processes-simultaneously) IniFormat should work and manage locking correctly, but it seems that sometimes it fails to do so.
Turning the locking safety off might solve this problem as stated [in the documentation](https://doc.qt.io/qt-6/qsettings.html#setAtomicSyncRequired) but it might create other issues (if multiple camitk applications are running and overwrite each other's settings).
## CamiTK Version
Stable 5.0 windows version
---
**please do not remove anything below this line**https://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/171Crash when printing debug information (F2 key)2023-11-24T16:35:20+01:00Manik BhattacharjeeCrash when printing debug information (F2 key)## About you
CamiTK developer
## Overview
When a component is displayed in InteractiveViewer, pressing the F2 key should display debug information in the log.
Instead, CamiTK crashes (segfault).
## Steps to Reproduce
- Run camitk-imp...## About you
CamiTK developer
## Overview
When a component is displayed in InteractiveViewer, pressing the F2 key should display debug information in the log.
Instead, CamiTK crashes (segfault).
## Steps to Reproduce
- Run camitk-imp
- Open a mesh (.obj) or an image (.nii)
- Push F2 key
## Actual VS Expected Result
IMP crashes and does not display debug information
## Interpretation & Possible fixes
Crash happens in InteractiveViewer.cpp when creating a list of all props from a component:
`std::list<vtkSmartPointer <vtkProp> > allActors(actorMap.values(c).begin(), actorMap.values(c).end());`
## CamiTK Version
Current develop branch of camitk-5.2
---
**please do not remove anything below this line**Manik BhattacharjeeManik Bhattacharjeehttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/170Elastix registration using the elastix command2023-11-26T18:34:59+01:00Emmanuel PromayonElastix registration using the elastix command| | |
|--|--|
| **As a** | camitk-imp user... |
| **I would like to** | register image using the elastix software from CamiTK |
| **So that** | I can change the main parameter, call elastix and see the registration result in CamiTK witho...| | |
|--|--|
| **As a** | camitk-imp user... |
| **I would like to** | register image using the elastix software from CamiTK |
| **So that** | I can change the main parameter, call elastix and see the registration result in CamiTK without using the command line |
| **Epic/Topics** | medical image registration |
## Description / Overview
Select main registration parameters in an Action interface. Apply registration using "Apply" button
Basically this issue is to perform [MISR tutorial 3](https://promayoe.gricad-pages.univ-grenoble-alpes.fr/walnut/tutorials/misr/03/index.html) using camitk-imp instead of the command line.
## Hints
Call elastix/elastix.exe from the action
## TrackEmmanuel PromayonEmmanuel Promayonhttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/168Fancy segfault2023-10-29T15:05:39+01:00Emmanuel PromayonFancy segfault## About you
CamiTK dev
## Overview
Application camitk-fancy crashed with segfault as soon as it starts.
## Steps to Reproduce
- build CamiTK with -DCEP_TUTORIAL=TRUE
- cd build
- bin/camitk-fancy
## Actual VS Expected Result
Crash...## About you
CamiTK dev
## Overview
Application camitk-fancy crashed with segfault as soon as it starts.
## Steps to Reproduce
- build CamiTK with -DCEP_TUTORIAL=TRUE
- cd build
- bin/camitk-fancy
## Actual VS Expected Result
Crash versus fancy main window opening
## Interpretation & Possible fixes
`comp` attribute is not set to nullptr
## CamiTK Version
CamiTK 5.2.0.develop.3480339c
Compiled using git Hash: 3480339c7626584d1ad62f045dbc5cf5b472345f, Date: Fri Jul 28 14:49:32 2023 +0200.Emmanuel PromayonEmmanuel Promayonhttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/158CamiTK File Format - metadata, scenes, processing scenarios...2024-02-13T23:09:12+01:00Manik BhattacharjeeCamiTK File Format - metadata, scenes, processing scenarios...| | |
|--|--|
| **As a** | CamiTK developer |
| **I would like to** | define a file format for CamiTK I/O |
| **So that** | CamiTK can load and save scenes, metadata associated with files, user preferences, scenarios for the state machin...| | |
|--|--|
| **As a** | CamiTK developer |
| **I would like to** | define a file format for CamiTK I/O |
| **So that** | CamiTK can load and save scenes, metadata associated with files, user preferences, scenarios for the state machine... |
| **Epic/Topics** | |
## Description / Overview
CamiTK needs to store multiple types of data. An extensible file format should be designed for the following use cases:
- Metadata files: storing LUT settings/color settings and geometrical transformations associated with a file, as well as CamiTK properties.
- Storing scenes (objects loaded, geometrical transformations, actions settings)
- Storing processing scenario such as used by the state machine to allow batch processing of data
- Storing user preferences
## Hints
- A human-readable format would be better (e.g. JSON)
- For scenes, CardioModel CEP and Meniscare CEP have scene formats to load multiple registered images together. but they should be made more generic
- The CamiTK state machine already has a XML-based format to define processing steps
## Acceptance tests
- [ ] Load a volume, register it to another image, set its LUT. Close CamiTK. When opening the image again, it should still be registered and keep its LUT settings.
- [ ] Any action should have its settings saved in the metadata of the file it was used on, and the settings should be loaded when opening the file again
- [ ] Loading a scene file reopens the scene as it was before closing it (all images, actions, viewers...)
- [ ] Opening a file, using multiple actions to get an output and saving it could be saved as a processing scenario, and applied to another input.
## 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/154Opening multiple DICOM series from one directory can result in a segfault2023-07-28T14:58:49+02:00Manik BhattacharjeeOpening multiple DICOM series from one directory can result in a segfault## About you
CamiTK developer
## Overview
When opening a DICOM directory, selecting multiple series to open sometimes crashes the software (segfault)
## Steps to Reproduce
Unfortunately I cannot share (yet) the data used to test. In ...## About you
CamiTK developer
## Overview
When opening a DICOM directory, selecting multiple series to open sometimes crashes the software (segfault)
## Steps to Reproduce
Unfortunately I cannot share (yet) the data used to test. In this DICOM directories, multiple series have the exact same name.
After launching camitk-imp, opening the directory and selecting two series (for example Axial and Coronal T2 acquisitions) will result in a crash.
## Actual VS Expected Result
Multiple Components should be loaded without crashing.
## Relevant logs and/or screenshots
From the debugger:
```gdb
#4 0x00007fffe41f0f71 in DicomSeries::getStudyName() const () from /home/bhattacm/Datas/prog/CamiTK2/build/lib/camitk-5.1/components/libdicom.so.5.1.dev
#5 0x00007fffe41e7ca9 in DicomComponentExtension::open(QString const&) () from /home/bhattacm/Datas/prog/CamiTK2/build/lib/camitk-5.1/components/libdicom.so.5.1.dev
#6 0x00007ffff7d2c7fa in camitk::Application::openDirectory (dirName=..., pluginName=...)
```
## Interpretation & Possible fixes
There may be three problems with the following code in DicomComponentExtension.cpp
```cpp
// Open each selected Dicom as a component
if (!seriesDialogEntries.isEmpty()) {
foreach (DicomDialogEntry* entry, seriesDialogEntries) {
// Find the corresponding Dicom Series in the List
foreach (DicomSeries* series, seriesParsed) {
if ((series->getStudyName() == entry->getStudyName()) &&
(series->getSeriesName() == entry->getSeriesName())) {
lastOpenedComponent = new DicomComponent(series);
break;
}
else {
delete series;
}
}
}
}
```
- The selected study is identified by name, and not ID. If two series have the same name, the first one will be loaded (may not be the correct one)
- "delete series;" statement will delete series that do not match the chosen serie's name **until the chosen series is found**. The series following this one will not be deleted (memory leak)
- if multiple series are selected, the outer loop will execute the inner loop a second time. At that point, **some series are already deleted but the inner loop will call getStudyName and getSeriesName on them** if they happen to be before the selected series in the seriesParsed list. This causes the segfault.
Proposed solutions:
- delete all series **after** the loops, not some of them (except if the series object is still stored somewhere in the DicomComponent)
- Try to use the series ID to find out which image was selected to avoid relying on the name which might not be unique
## 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/153DicomComponent ignores DICOM orientation2023-07-26T16:19:28+02:00Manik BhattacharjeeDicomComponent ignores DICOM orientation## About you
CamiTK developer
## Overview
When using DicomComponent to load a volume, the image transform from DICOM header is ignored.
## Steps to Reproduce
Load a Dicom volume (e.g. MRI) that was not acquired directly in the orient...## About you
CamiTK developer
## Overview
When using DicomComponent to load a volume, the image transform from DICOM header is ignored.
## Steps to Reproduce
Load a Dicom volume (e.g. MRI) that was not acquired directly in the orientation of the scanner.
Observe that the Frame transform to world coordinates is identity
## Actual VS Expected Result
The frame transform between the loaded DicomComponent and world coordinates should be the transform stored in the DICOM (Image Position and Orientation of Patient).
## Interpretation & Possible fixes
CardioModel CEP Dicom Component (from @lecesnee and @fouardc) implements reading the transform and setting it in the frame of the component. Importing the code into the current DicomComponent should solve this.
## 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/150update gitlab runner accordingly2023-06-16T13:27:23+02:00Emmanuel Promayonupdate gitlab runner accordinglyhttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/149remove old testing image2023-06-16T13:27:36+02:00Emmanuel Promayonremove old testing imagehttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/148register and push to local repository2023-06-16T13:30:00+02:00Emmanuel Promayonregister and push to local repositoryhttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/147Create docker image2023-06-16T13:30:15+02:00Emmanuel PromayonCreate docker imagehttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/146Update Dockerfile2023-06-16T13:29:46+02:00Emmanuel PromayonUpdate Dockerfile