CamiTK Community Edition issueshttps://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues2023-11-24T19:10:15+01:00https://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)https://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/issues/72use setProperty with QString instead of char*2020-05-18T14:55:02+02:00Matthias Tummersuse setProperty with QString instead of char*| | |
|--|--|
| **As a** | CEP developer |
| **I would like** | a `setProperty` with `const QString name` instead of `const char * name` |
| **To** | improve camitk code consistency |
| **Epic/Topics** | Property setProperty QString char...| | |
|--|--|
| **As a** | CEP developer |
| **I would like** | a `setProperty` with `const QString name` instead of `const char * name` |
| **To** | improve camitk code consistency |
| **Epic/Topics** | Property setProperty QString char* |
## Description / Overview
I noticed that the `QObject::setProperty` method prototype demands a `const char *` type for the first argument whereas the `camitk::Property` constructor and the `getProperty` method use a `QString` type.
I think it might be a good idea to implement a method looking like
```cpp
//PropertyObject.h
virtual bool setProperty(const QString name, const QVariant &value);
```
```cpp
//PropertyObject.cpp
bool PropertyObject::setProperty(const QString name, const QVariant &value) {
if (propertiesMap.contains(name)) {
return setProperty(name.toStdString().c_str(), value);
}
else {
return false;
}
}
```
,
to be re-implemented in component and action.
(just like `getPropertyValue` (which I think should be re-implemented in component and action too (for the same reason)))
This would allow manipulating camitk properties only with QStrings and not with a mix of qstrings and char* types depending on the method being used.
## Acceptance tests
- **SetProperty works with QString**
One is able to set a property with the setProperty method using a QSting for the first argument
- **All uses of setProperty in CamiTK and CEPs are updated**
CamiTK and CEPs compile without errors regarding the setProperty method
## Track
One (or two) of:
## Misc
- Automatic subscription of issue creator:
**Do not forget to mark this issue as "confidential"** by checking the tick box below (if appropriate)