diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e12b9a7..aed86e9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,3 +19,6 @@ Wish to contribute to the development of this 3D Slicer module/extension? As a t * [PEP8 style guide official documentation](https://peps.python.org/pep-0008/) * [Polytechnique Montreal Home-Made Guide for programming style (in French)](https://github.com/INF1007-Gabarits/Guide-codage-python) + +[GO on Documentation Welcome Page](./SlicerCART/documentation/welcome.md). +[GO on README.md Page](README.md). \ No newline at end of file diff --git a/README.md b/README.md index cf85397..4ea9c62 100644 --- a/README.md +++ b/README.md @@ -2,105 +2,31 @@ ![](SlicerCART/src/Resources/Icons/SlicerCART.png) SlicerCART: Configurable Annotation and Review Tool. -## Description +This is a 3D Slicer extension aimed to improve workflow in manual +segmentation, classification and revision tasks. SlicerCART +enables to +quickly load specific volumes of a dataset and navigate through them, +perform manual segmentation of medical images (e.g. annotating +multiple sclerosis lesions on MRI) or compare different segmentation +versions (e.g. lesion segmentation generated by a deep learning-based model). -* 3D Slicer extension -* Adapted from code of Dr. Laurent Létourneau-Guillon and his team in [ICH_SEGMENTER_V2](https://github.com/laurentletg/ICH_SEGMENTER_V2), [SlicerCART](https://github.com/laurentletg/SlicerCART), and [Brain_Extraction](https://github.com/MattFr56/CT_Brain_Extraction/blob/main/Brain_Extraction/Brain_Extraction/Brain_Extraction.py). This is an effort to create a unified code for a configurable 3D Slicer extension. -* Inspired from [Neuropoly](https://neuro.polymtl.ca/)'s workflow. -* This tool is made to improve manual segmentation and classification workflows across different teams. +## [Installation](./SlicerCART/documentation/installation.md) -**Keywords:** medical imaging, manual segmentation, manual correction, workflow, ground-truth segmentation, quality control +## [QuickStart](./SlicerCART/documentation/quickstart.md) -**Abbreviations:** +## [See Documentation](./SlicerCART/documentation/welcome.md) -- MRI - Magnetic Resonance Imaging -- CT - Computed Tomography -- BIDS - Brain Imaging Data Structure -- GUI - Graphical User Interface -- QC - Quality Control -**Rationale:** - -* Manual segmentation and classification tasks are required in the research setting related to medical imaging artificial intelligence tool development -* An open-source solution for such tasks would better benefit the research setting -* Actual open-source solutions that enable imaging viewing and annotation are not optimal from an end-user standpoint (especially from various background), increasing the already high burden of manual segmentation and classification tasks -* A workflow aimed to efficiently navigate through a dataset while performing manual segmentation / correction, including revision steps and robust annotation consistency assessment is crucial for handling large amount of data and provide the best ground-truth references segmentation as possible. - -**Module specific functions (in details)** - -This module has been adapted to perform several tasks. Among other things, it allows the user to: - -* Customize configuration preferences (see below for details) -* Customize keyboard shortcuts -* Identify the name, degree and revision step related to the human annotator -* Select folder of interest where volumes are saved (and possibly impose BIDS) -* Select the output folder where processing and work is preferred to be saved -* Select a ground-truth folder where references studies can be used for iterative self-assessment -* Display in the GUI a case list of all the studies of interests for the segmentation task (*from a site directory or a customized list) -* Select from the GUI case list any volume of interest to display -* Navigate through case list from next and previous buttons -* Load automatically the first remaining case for segmentation in a customized list -* Create automatically all required segments that may be used according to the project configuration each time a volume is displayed -* Toggle interpolation of the volume loaded -* Execute multiple automated functions when saving segmentation masks for a given volume. Indeed, the automated functions: - * Save segmentation masks in the selected output folder with volume file hierarchy - * Track the different versions (save the following version if previous version(s) already exist(s)) **N.B. limitation to 99 versions for a single volume* - * Save a .csv file with segmentation statistics (e.g. subject, annotator's name and degree, revision step, date and time, total duration, duration of each label annotation) - * Save a .csv file with classification statistics (e.g. subject, annotator's name and degree, revision step, date and time, checkboxes / dropdown / free text fields) - * Go to the next remaining case and make it ready to segment without any further action -* Load a pre-existing segmentation for further modification (will be saved as a new version of the segmentation) - -### Requirements - -* MacOS Sonoma or Sequoia is recommended -* A working version of [3D Slicer](https://download.slicer.org). - * N.B. The version currently used to develop this module is the version 5.6.2 (most stable release as of 2024-10-22). The version 5.2.2 has also been used. - -This module has been developed on: - -* MacOS Sonoma version 14.1.1 and Sequoia 15.0.1 -* 3D Slicer version 5.6.2 - -Although it may work on other versions and/or operating system, please note that it has not been tested. - -## Installation steps - -If previous version of Slicer ---» delete the app. If on MacOS, you can do it by doing right lick on the app in the application folder --- move to trash --- go to trash --- empty the trash --- restart your computer. - - -1. Install [3D Slicer](https://download.slicer.org). -2. Clone this repository in the location of your choice. -3. Then, go in the finder --- find the file SlicerCART.py file, and copy the pathname. -4. Open 3D Slicer. -5. Activate the checkbox `Enable developer mode` in `Edit -> Application Settings -> Developer -> Enable developer mode`. -6. Add the path of the `SlicerCART.py` file in `Edit -> Application Settings -> Modules -> Additional module paths`.(N.B. 1) You must have the file: if it is the folder path, then the module will not work; 2) in the Additional modul path section, the path copied might be shown to the folder: this is a Slicer thing, and should not affect working property of the module if it was the file that you copied). -7. The module can be found under `Examples -> SlicerCART`: the module should now be opened (N.B. 1) If first use, you may have additional requirements to install. A pop-up window from Slicer advertising you should pop-up if so: just click ok). -8. (Optional) Set the SlicerCART module to launch at 3DSlicer startup. To do so, go to `Edit -> Application Settings -> Modules -> Default startup module` -9. There might be errors. These would be seen in the Python Console: if any errors, we highly recommend you to fix them before any further use! - -### Trouble shooting - -* Qt might need to be installed. The first five steps of the following procedure might be useful for this: [procedure](https://web.stanford.edu/dept/cs_edu/resources/qt/install-mac). - -### Other extensions that could be useful -* `SlicerJupyter` to be able to use Jupyter Notebooks connected to 3D Slicer. - -### Documentation -TODO (after sufficient development has been made) - -### Video tutorials -TODO (after sufficient development has been made) +### Contributors -### Other resources -* [3D Slicer Tutorials](https://www.youtube.com/watch?v=QTEti9aY0vs&) -* [3D Slicer Documentation](https://www.slicer.org/wiki/Documentation/Nightly/Training) +1. Adapted from code of Dr. Laurent Létourneau-Guillon and his team in [ICH_SEGMENTER_V2](https://github.com/laurentletg/ICH_SEGMENTER_V2), [SlicerCART](https://github.com/laurentletg/SlicerCART), and [Brain_Extraction](https://github.com/MattFr56/CT_Brain_Extraction/blob/main/Brain_Extraction/Brain_Extraction/Brain_Extraction.py). This is an effort to create a unified code for a configurable 3D Slicer extension. +2. Inspired from [Neuropoly](https://neuro.polymtl.ca/)'s workflow. -### Contributors -[![Contributors](https://img.shields.io/github/contributors/neuropoly/slicer-manual-annotation/graphs/contributors)](https://github.com/neuropoly/slicer-manual-annotation/graphs/contributors), including: +1. [![Contributors](https://img.shields.io/github/contributors/neuropoly/slicer-manual-annotation/graphs/contributors)](https://github.com/neuropoly/slicer-manual-annotation/graphs/contributors), including: -* Laurent Létourneau-Guillon -* Emmanuel Montagnon -* An Ni Wu -* Maxime Bouthillier -* Delphine Pilon -* Neuropoly Team + * Laurent Létourneau-Guillon + * Emmanuel Montagnon + * An Ni Wu + * Maxime Bouthillier + * Delphine Pilon + * Neuropoly Team diff --git a/SlicerCART/documentation/functionalities.md b/SlicerCART/documentation/functionalities.md new file mode 100644 index 0000000..ef878cc --- /dev/null +++ b/SlicerCART/documentation/functionalities.md @@ -0,0 +1,83 @@ +# SlicerCART Functionalities + +This section lists the functionalities of SlicerCART. If the function you +are looking for is not found below, it is likely that SlicerCART does not have +yet +this feature: you are invited to open an issue on the [Github Repository](https://github.com/neuropoly/slicer-manual-annotation/issues) to +request the functionality you are looking for. + +**Specific functions (in details)** + +This module has been adapted to perform several tasks. Among other things, it allows the user to: + +* Customize configuration preferences for optimizing workflow for + segmentation or classification tasks, including: + * Task Selection (Segmentation and/or Classification) + * Modality to be viewed/process/annotated (CT or MRI) + * (Must one or the other for now. Does not currently take DICOM images) + * Brain Imaging Data Structure (BIDS) format imposition (test quickly if a + dataset respects the BIDS convention through a BIDS-validator script: + makes unable to load a dataset if it does not respect BIDS format) + * View to be displayed by default in the Slicer viewer (e.g. + axial, sagittal, etc.) + * Interpolation of images (by default, Slicer images that are displayed + get "interpolated" (i.e. smoother): with SlicerCART, you can select this + option that can be relevant for segmentation tasks) + * For CT-Scans: + * Specify the range of Houndsfield units for which a segmentation mask + will be feasible (e.g. 45 to 90): otherwise, segmentation mask will + not be created. + * Customize keyboard shortcuts + * Customize mouse button functions + * Configure from the GUI the segmentation labels, + including: + * Label name + * Label value + * Color + * Adding/Removal of labels + * Select if timer should be displayed during segmentation task + * Configure from the GUI the classification labels, + including adding/Removal of: + * Labels + * Checkbox + * DropDown Menu with choice selection + * Text field + * (Specify to save all segments to one file or multiple files)TO DO +* Identify the name, degree and revision step related to the human annotator +* Select folder of interest where volumes are saved (and possibly impose BIDS) + * Displays automatically the PATH of the loaded volume +* Select the output folder where processing and work is preferred to be saved +* (Select a ground-truth folder where references studies can be used for + iterative self-assessment)TO COME +* Display in the GUI a case list of all the studies of interests for the segmentation task (*from a site directory or a customized list) +* Select from the GUI case list any volume of interest to display +* Navigate through case list from next and previous buttons +* (Load automatically the first remaining case for segmentation in a + customized list)TO COME +* Create automatically all required segments that may be used according to the project configuration each time a volume is displayed +* From the Segmentation window: + * Open quickly the Segment Editor + * Start Painting for the first label + * Erase any part of visible masks + * Select Lasso Paint (fills the space of a contour-based geometrical + annotation) + * (Place a measurement line) TO COMPLETE +* Toggle interpolation of the volume loaded +* Execute multiple automated functions when saving segmentation masks for a given volume. Indeed, the automated functions: + * Save segmentation masks in the selected output folder with volume file hierarchy + * Track the different versions (save the following version if previous version(s) already exist(s)) **N.B. limitation to 99 versions for a single volume* + * Save a .csv file with segmentation statistics (e.g. subject, annotator's name and degree, revision step, date and time, total duration, duration of each label annotation) + * Save a .csv file with classification statistics (e.g. subject, annotator's name and degree, revision step, date and time, checkboxes / dropdown / free text fields) + * (Go to the next remaining case and make it ready to segment without any + further action)TO COME +* Load a pre-existing segmentation for further modification (will be saved as a new version of the segmentation) +* Compare different versions of segmentation TO COMPLETE + * Specify versions to be loaded at the same time + * Display multiple versions of segmentation masks at the same time + * Modify specific segments of different versions + * Save all segments displayed +- modified on the viewer as a version += 1 + of segments in the output folder + +[GO BACK on Documentation Welcome Page](welcome.md). +[Go BACK to User Guide](userguide.md). +[CONTINUE to Purpose](purpose.md). \ No newline at end of file diff --git a/SlicerCART/documentation/images/continue_segmentation.png b/SlicerCART/documentation/images/continue_segmentation.png new file mode 100644 index 0000000..7eeb856 Binary files /dev/null and b/SlicerCART/documentation/images/continue_segmentation.png differ diff --git a/SlicerCART/documentation/images/example_loading_cases_ui.png b/SlicerCART/documentation/images/example_loading_cases_ui.png new file mode 100644 index 0000000..7c22c05 Binary files /dev/null and b/SlicerCART/documentation/images/example_loading_cases_ui.png differ diff --git a/SlicerCART/documentation/images/folder_and_name_to_use.png b/SlicerCART/documentation/images/folder_and_name_to_use.png new file mode 100644 index 0000000..5575f11 Binary files /dev/null and b/SlicerCART/documentation/images/folder_and_name_to_use.png differ diff --git a/SlicerCART/documentation/images/module_filepath.png b/SlicerCART/documentation/images/module_filepath.png new file mode 100644 index 0000000..cf70346 Binary files /dev/null and b/SlicerCART/documentation/images/module_filepath.png differ diff --git a/SlicerCART/documentation/images/perform_segmentation.png b/SlicerCART/documentation/images/perform_segmentation.png new file mode 100644 index 0000000..8251ba0 Binary files /dev/null and b/SlicerCART/documentation/images/perform_segmentation.png differ diff --git a/SlicerCART/documentation/images/save_segmentation.png b/SlicerCART/documentation/images/save_segmentation.png new file mode 100644 index 0000000..e2a4bcb Binary files /dev/null and b/SlicerCART/documentation/images/save_segmentation.png differ diff --git a/SlicerCART/documentation/images/select_configuration_module.png b/SlicerCART/documentation/images/select_configuration_module.png new file mode 100644 index 0000000..7341ef7 Binary files /dev/null and b/SlicerCART/documentation/images/select_configuration_module.png differ diff --git a/SlicerCART/documentation/images/select_configuration_popup.png b/SlicerCART/documentation/images/select_configuration_popup.png new file mode 100644 index 0000000..2926c03 Binary files /dev/null and b/SlicerCART/documentation/images/select_configuration_popup.png differ diff --git a/SlicerCART/documentation/images/select_output_folder.png b/SlicerCART/documentation/images/select_output_folder.png new file mode 100644 index 0000000..0737b6b Binary files /dev/null and b/SlicerCART/documentation/images/select_output_folder.png differ diff --git a/SlicerCART/documentation/images/select_volume_to_segment.png b/SlicerCART/documentation/images/select_volume_to_segment.png new file mode 100644 index 0000000..2d1a3dd Binary files /dev/null and b/SlicerCART/documentation/images/select_volume_to_segment.png differ diff --git a/SlicerCART/documentation/images/start_segmentation.png b/SlicerCART/documentation/images/start_segmentation.png new file mode 100644 index 0000000..8251ba0 Binary files /dev/null and b/SlicerCART/documentation/images/start_segmentation.png differ diff --git a/SlicerCART/documentation/installation.md b/SlicerCART/documentation/installation.md new file mode 100644 index 0000000..94102b5 --- /dev/null +++ b/SlicerCART/documentation/installation.md @@ -0,0 +1,62 @@ +# SlicerCART Installation + +## Requirements + +* MacOS Sonoma or Sequoia (15.0.1) is recommended +* [3D Slicer](https://download.slicer.org) version 5.6.2. +* Qt: might need to be installed. + * The first five steps of the following procedure might be useful for this: [procedure](https://web.stanford.edu/dept/cs_edu/resources/qt/install-mac). + * You can try importing Qt in the Slicer python console (e.g. `import slicer ` then `from slicer.util import Qt`) + +*Although it may work on other versions and/or operating system, please note +that it has not been tested. + +If 3D Slicer has not been already installed, you can follow these steps: +1. Install [3D Slicer](https://download.slicer.org): +2. Make sure that you are able to open and use the 3D Slicer software before + trying installing any extension/module. +3. If you encounter some problems, you are encouraged to refer to: + * [3D Slicer Documentation](https://slicer.readthedocs.io/en/latest/) + * [3D Slicer forum](https://discourse.slicer.org/) (very active community) + +## Installation Steps + +1. Clone the [SlicerCART repository](https://github.com/neuropoly/slicer-manual-annotation) in the location of your choice. +2. Open 3D Slicer. +3. Activate the checkbox `Enable developer mode` in `Edit + -> Application + Settings -> Developer -> Enable developer mode`. +4. Open Finder (on macOS). Go to the location of the SlicerCART Repository. + Go to the location of the python file `SlicerCART.py` (_should only have one + FILE of that name. Note that if you add the path of the folder SlicerCART, + it will not work: you MUST add the path of SlicerCART.py FILE_) in `Edit -> Application Settings + -> Modules -> Additional module paths`. See image example below: +![](images/module_filepath.png) + +Warning: be sure to drag and drop `SlicerCART.py` and not `SlicerCART` (the folder). + +5. The Application will ask to Restart: click Ok. +![](images/example_restart.png) + +6. The module can be found under `Examples -> SlicerCART`: the module should + now be opened (N.B. If first use, you may have additional requirements + to install. A pop-up window from Slicer advertising you should pop-up if so: just click ok). +![](images/example_slicercart.png) + + +8. (Optional) Set the SlicerCART module to launch at 3DSlicer startup. To do so, go to `Edit -> Application Settings -> Modules -> Default startup module` + +Note: There might be errors in the Python Console: if so, we highly recommend you to fix them before any further use! + + +**In Summary:** + +Install 3D Slicer --- Enable Developer Mode --- Add the PATH of SlicerCART. +py file in the modules list --- (Optional) Select to launch SlicerCART at 3D +Slicer --- restart 3D Slicer --- READY FOR USE! + + + +[GO BACK on Documentation Welcome Page](welcome.md). +To continue the tutorial and start using SlicedCARD click here: [QuickStart](quickstart.md). + diff --git a/SlicerCART/documentation/purpose.md b/SlicerCART/documentation/purpose.md new file mode 100644 index 0000000..c8d732b --- /dev/null +++ b/SlicerCART/documentation/purpose.md @@ -0,0 +1,16 @@ +# SlicerCART Purpose + +This section explains the rationale behind SlicerCART and its purpose. + + +**Rationale:** + +* Manual segmentation and classification tasks are required in the research setting related to medical imaging artificial intelligence tool development +* An open-source solution for such tasks would better benefit the research setting +* Actual open-source solutions that enable imaging viewing and annotation are not optimal from an end-user standpoint (especially from various background), increasing the already high burden of manual segmentation and classification tasks +* A workflow aimed to efficiently navigate through a dataset while performing manual segmentation / correction, including revision steps and robust annotation consistency assessment is crucial for handling large amount of data and provide the best ground-truth references segmentation as possible. + +[GO BACK on Documentation Welcome Page](welcome.md). +[GO BACK on List of Functionalities Page](functionalities.md). +[CONTINUE to Developer Guide](../../CONTRIBUTING.md). + diff --git a/SlicerCART/documentation/quickstart.md b/SlicerCART/documentation/quickstart.md new file mode 100644 index 0000000..e6237f2 --- /dev/null +++ b/SlicerCART/documentation/quickstart.md @@ -0,0 +1,128 @@ +# SlicerCART QuickStart + +Follow the steps below to use SlicerCART. + +### Important Note: +Currently, SlicerCART **works only for one task**: viewing and perform manual +segmentations from scratch. + +The current version **IS NOT** able to: +- Edit segmentation labels +- Continue segmentation/classification tasks from previously started work +- Adjust by default the window width (some dataset provides blank images + that need to be adjusted automatically. If it's the case, mention your + concern in [issue 67](https://github.com/neuropoly/slicer-manual-annotation/issues/67)) +- Go automatically to the next case after having saved a segmentation +- Compare multiple segments and revise them ... + +Essential functionalities still remain to be implemented for a release. +There are also significant bugs. Nevertheless, your feedback would be very +appreciated for 1) Installation steps 2) Loading datasets 3) General Insight. + + +### Before starting + +You should have: +* Successfully installed 3D Slicer +* Sucessfully installed SlicerCART + +Please review [Installation Steps](installation.md#installation-steps) if those criteria are not +fullfilled. + + + +### Getting started + +**Example use case:** viewing different volumes in a given dataset and +perform manual segmentations + + + +###### 1. Open 3D Slicer +###### 2. Launch SlicerCART +###### 3. Select "New Configuration", and click on Next +When the module is loaded, a pop-up window appears and allow the user to +customize SlicerCART settings. + +![Alt Text](images/select_configuration_popup.png) + +###### 4. Specify the appropriate dataset options and tasks, and then click Apply +For example, select if you will complete segmentation and/or classification +tasks, the modality (takes only 1 for now), if you impose BIDS (will pass a +BIDS validator test before loading volumes), dataset volumes extensions (i.e. +Input File Extension), etc. + +By default, some segmentation labels will be used. We recommend for now to +use those (soon, it should be able to modify them by clicking on Configure +Segmentation). The same applies for "Configure Classification". + +![Alt Text](images/select_configuration_module.png) + + +###### 5. Select Volumes folder, and specify annotator information +* Select the folder that contains the images that you want to process (if +* BIDS folder, will not consider images in derivatives), manipulate, view, etc. + +* Specify the Annotator name, degree and revision step (all are mandatory +* for saving functions). + +![Alt Text](images/folder_and_name_to_use.png) +![Alt Text](images/example_loading_cases_ui.png) + + + +N.B. If loading cases in the UI fails, please open an issue on the Github + repository or ask a team member. If this steps has not succeed, you will + not be able to use SlicerCART (e.g. imaging format incompatibility). + + +###### 6. Select Output folder +Select the folder where output data (e.g. segmentation masks, statistics) +will be saved. For now, it must be empty. +![Alt Text](images/select_output_folder.png) + +###### 7. Display Volume to Segment +Click on the case in Case list you want display and/or perform segmentation, +so it will be shown in the Slicer Viewer. +![Alt Text](images/select_volume_to_segment.png) + +###### 8. Start Segmentation +Click on the case you want to +Start segmentation by clicking on: +- SegmentEditor: will open the default segment editor of 3D Slicer +- Paint: will make the user able to paint the **first** mask label +- Erase: will make the user able to erase current segment label + +![Alt Text](images/perform_segmentation.png) + +###### 9. Save Segmentation +Once segmentation is completed, click on Save segmentation to save the +segmentation mask in the output folder. Note that a .csv file will be +generated for basic segmentation statistics (e.g. time of segmentation, +annotator information, etc.). +![Alt Text](images/save_segmentation.png) + +###### 10. Continue Segmentation +Click in the Case list on the next case you want to segment. +![Alt Text](images/continue_segmentation.png) + +### Further Improvements +Functionalities soon to be implemented: +* Load from non-empty volume folder, enabling to load automatically the next +remaining case in a list of segmentation cases to be done +* Load automatically the paint feature for the first label when starting segmentation +* Go automatically to the next remaining case when saving segmentation + +For any feedback, please add your comments on: https://docs.google.com/document/d/1RRDnYuUtevRtKzdGpOBCORbUAweMCMtD0bUfg_Qt2qE/edit?usp=sharing + +If you have any question and/or inquiry, please feel free to open a new +issue on the [SlicerCART Github repository](https://github. +com/neuropoly/slicer-manual-annotation/issues) + +Thank you! + +The SlicerCART Team + +[GO BACK on Documentation Welcome Page](welcome.md). +[GO BACK on Installation Page](installation.md). +[CONTINUE to Video Tutorials](videotutorials.md). \ No newline at end of file diff --git a/SlicerCART/documentation/userguide.md b/SlicerCART/documentation/userguide.md new file mode 100644 index 0000000..5dbf034 --- /dev/null +++ b/SlicerCART/documentation/userguide.md @@ -0,0 +1,136 @@ +# SlicerCART User Guide + +Detailed information for using SlicerCART in 3D Slicer is provided below. + +### Startup + +When the module is loaded, a pop-up window appears and allow the user to preset the module according to the intended use case. + +![](images/select_configuration_popup.png) + +###### New configuration + +To select when the module is used for a new task. + + +###### Continue from existing output folder + +To select when the module is used for continuing a previously started task. + +###### Use template configuration + +To select when the user wants to load its own configuration template in the SlicerCART. WIP + +### New configuration + +A pop-up windows allow to specify parameters and customize settings. + +![](images/select_configuration_module.png) + + + +* **Task:** select if the module is used for segmentation, classification or both. +* **Modality:** select if volumes are CT-Scans or MRI +* **Impose BIDS?:** related to folder organization and files naming convention. Select yes if you want to load volumes only if the folder organization respects the Brain Imaging Data Structure (BIDS) format (once a volume folder will be selected, a BIDS validator will be run and a pop-up window will show if the selected folders do not respect BIDS: in the case, the volumes will not be able to load if BIDS is imposed). +* **Input File Extension:** specify the files’extension. Currently, nifti and nrrd format are accepted only (supported by Slicer). Note that if a dataset (i.e. volume folder) contains both nifti and nrrd volumes, the module will not be able to work (you can choose either one or another but not both). +* **Initial View:** select the plan (axial, sagittal, or coronal) that the 3D Slicer viewer will display. Soon, implementation of viewing the same volume in different planes (e.g. different plan) will be done. +N.B. In 3D Slicer, each viewer plane has an associated color: Red – Axial; +Yellow – Sagittal; +Green – Coronal +![](images/slicer_viewer.png) +* **Interpolate Image?:** select if loaded volumes from raw MRI data have + automated postprocessing treatment to make the image smoother. Note that + this is usually automatically done in Slicer: however, for example, + deep-learning based model used for segmentation are trained on raw MRI + data which may create unprecise ground-truth segmentation masks or + compatibility issues. Note also that although if images are interpolated, + segmentation masks are bu default saved without any smoothering filter + (compatible for deep learning model training) +* **If Modality == CT:** +The Window Level and Window With default level can be selected, enabling to display a specific default contrast for each volume. Accepts only integers +Note that if you have selected CT, but do not want to specify the contrast information, the default volumes will be loaded using a Window Width/Level of 45:85 +* **Use Custom Keyboard Shortcuts?:** +Select to show a dropdown menu enabling customization of keyboard shortcuts + for predefined basic functions. Name of the proposed shortcut corresponds + to its action. +* **Use Custom Mouse Shortcuts?:** +Select to show a dropdown menu enabling customization of mouse button functions for image navigation and manipulation in the 3D Slicer viewer. + +###### Configure segmentation + +Allows the user to specify the default labels name, value and display colors for each segmentation mask in the dataset. For example, if the tasks is to do segmentation of brain hemorrhage, intraventricular hemorrhage and peri-hematoma edema, the user can specify the label names (e.g. ICH --- for intracranial hemorrhage; IVH --- for intraventricular hemorrhage; PHE --- perihematomal edema) +The user can change the number of labels by clicking remove or add. +Click apply to save the segmentation configuration. + +###### Configure Classification + +Allows the user to specify the labels and their value related to +classification types, and their selection mode. Click on Apply to save the configuration settings. + +The user is now ready to start doing segmentation, classification or both tasks! + +### Start Segmentation and/or Classification + +###### Select Volumes folder, and specify annotator information +* Select the folder that contains the images that you want to process (if +* BIDS folder, will not consider images in derivatives), manipulate, view, etc. + +* Specify the Annotator name, degree and revision step (all are mandatory +* for saving functions). + +![Alt Text](images/folder_and_name_to_use.png) +![Alt Text](images/example_loading_cases_ui.png) + + + +N.B. If loading cases in the UI fails, please open an issue on the Github + repository or ask a team member. If this steps has not succeed, you will + not be able to use SlicerCART (e.g. imaging format incompatibility). + + +###### Select Output folder +Select the folder where output data (e.g. segmentation masks, statistics) +will be saved. For now, it must be empty. +![Alt Text](images/select_output_folder.png) + +###### Display Volume to Segment +Click on the case in Case list you want display and/or perform segmentation, +so it will be shown in the Slicer Viewer. +![Alt Text](images/select_volume_to_segment.png) + +###### Start Segmentation +Click on the case you want to +Start segmentation by clicking on: +- SegmentEditor: will open the default segment editor of 3D Slicer +- Paint: will make the user able to paint the **first** mask label +- Erase: will make the user able to erase current segment label + +![Alt Text](images/perform_segmentation.png) + +###### Save Segmentation +Once segmentation is completed, click on Save segmentation to save the +segmentation mask in the output folder. Note that a .csv file will be +generated for basic segmentation statistics (e.g. time of segmentation, +annotator information, etc.). +![Alt Text](images/save_segmentation.png) + +###### Continue Segmentation +Click in the Case list on the next case you want to segment. +![Alt Text](images/continue_segmentation.png) + + +TODO Next step for User Guide Documentation: +* Continue form existing output folder: If Continue from existing output + folder was selected, a pop-up window takes the user to select the output folder of the results where + +* Classification Documentation +* Assessment Documentation + +[GO BACK on Documentation Welcome Page](welcome.md). +[GO BACK to Video Tutorials](videotutorials.md). +[CONTINUE to List of Functionalities](functionalities.md). + + + + + diff --git a/SlicerCART/documentation/videotutorials.md b/SlicerCART/documentation/videotutorials.md new file mode 100644 index 0000000..8545135 --- /dev/null +++ b/SlicerCART/documentation/videotutorials.md @@ -0,0 +1,12 @@ +# Video Tutorials + +Here are useful video tutorials showing different features of SlicerCART. + +* Basic example: [segmentation of cases in a dataset](https://www.dropbox. + com/scl/fi/vna8dcfbaqgzbjuaxqpbe/20241108_scenario1_viewing_and_segment. + mov?rlkey=pttbxm0n3lzwfqmqkjq8ite8c&st=lte7mfqc&dl=0) (2024-11-18) + + +[GO BACK on Documentation Welcome Page](welcome.md). +[GO BACK to QuickStart](quickstart.md). +[CONTINUE to User Guide](userguide.md). \ No newline at end of file diff --git a/SlicerCART/documentation/welcome.md b/SlicerCART/documentation/welcome.md new file mode 100644 index 0000000..8d6ac5e --- /dev/null +++ b/SlicerCART/documentation/welcome.md @@ -0,0 +1,35 @@ +# Welcome to SlicerCART Documentation +Here is useful information for using SlicerCART in 3D Slicer. + +Please click on the following links to get started. + +* [Installation](installation.md) +* [QuickStart](quickstart.md) +* [Video Tutorials](videotutorials.md) +* [User Guide](userguide.md) (contains detailed information) +* [Developer Guide](../../CONTRIBUTING.md) (Contributing Guidelines) + +### Description + +SlicerCART is a 3D Slicer extension aimed to improve manual segmentation and classification +workflows across different teams. + +More information about SlicerCART Purpose can be found [here](purpose.md). + +List of functionalities can be found [here](functionalities.md). + +**Keywords:** medical imaging, manual segmentation, manual correction, workflow, ground-truth segmentation, quality control + +**Abbreviations:** + +- MRI - Magnetic Resonance Imaging +- CT - Computed Tomography +- BIDS - Brain Imaging Data Structure +- GUI - Graphical User Interface +- QC - Quality Control + + +### Other resources +* [3D Slicer Tutorials](https://www.youtube.com/watch?v=QTEti9aY0vs&) +* [3D Slicer Documentation](https://www.slicer.org/wiki/Documentation/Nightly/Training) + diff --git a/SlicerCART/src/configuration_config.yml b/SlicerCART/src/configuration_config.yml index e1fe689..323fe1e 100644 --- a/SlicerCART/src/configuration_config.yml +++ b/SlicerCART/src/configuration_config.yml @@ -70,7 +70,7 @@ freetextboxes: impose_bids_format: false input_filetype: '*.nii.gz' interpolate_value: 0 -is_classification_requested: true +is_classification_requested: false is_display_timer_requested: false is_keyboard_shortcuts_requested: true is_mouse_shortcuts_requested: true @@ -92,4 +92,4 @@ labels: upper_bound_HU: 90 value: 2 modality: MRI -slice_view_color: Yellow +slice_view_color: Red