Giter VIP home page Giter VIP logo

slicerautomateddentaltools's Introduction

Slicer Automated Dental Tools

The Slicer Automated Dental Tools extension provides automatic dental and craniofacial analysis capabilities. It features a user-friendly graphical interface on 3D Slicer, enabling users to perform complex tasks without any coding expertise.

Extension Logo

Compatible with both stable and nightly versions of 3D Slicer. Latest versions supported: 5.7.0 (nightly) and 5.6.1 (stable)

Overview

Slicer automated dental tools is an extension that allows users to perform automatic segmentation, landmark identification and Automatic Orientation on CBCT scans and Intra Oral Scan (IOS) using machine learning tools where the learning mdoels are continously updated.

Exemples

Features

  • Simple: Perform time consuming task with a few clicks.
  • Automatic: Automate important Dental and Cranio Facial analysis tasks.
  • Flexible: The user can choose which models to use to perform the automated task. New models can be added easily.

Modules

Name Description
AMASSS Perform automatic segmentation of CBCT scan. AMASSS is an acronym for Automatic Multi-Anatomical Skull Structure Segmentation.
ALI Perform automatic landmark identification on either CBCT or IOS scans. ALI is an acronym for Automatic Landmark Identification.
ASO Perform automatic orientation either on IOS or CBCT files.
AReg Perform automatic registration on IOS or CBCT files.
AutoCrop3D Automatically crop a folder of CBCT scans with the same region of interest.
AutoMatrix Automatically apply one or different matrix to a folder of IOS or CBCT scans.
MRI2CBCT Contains the steps to perform the registration of MRI and CBCT scans.
FlexReg Registration of IOS patient per patient with customizable patch creation.

These modules provide a convenient user interface, are available through the Automated Dental Tools module category, and share common features :

Input

  • All modules can work with one file or a whole sample (folder) as input.
  • If the input is a single file already loaded, the result of the predicton will directly show up on the slice views.

Output

  • By selecting the "Group output in a folder" checkbox, all the ouput files will be grouped in a single folder for each patient.
  • All modules allows the user to save the output in the input folder, or by unchecking the "Save prediction in scan folder" the user can choose a custom output folder.
  • The "Prediction ID" field is for the user to choose what will appear on the output file name. ("Pred" by default)

Additionally, the following modules are implemented as python scripted command-line (CLI) modules available in the Automated Dental Tools.Advanced module category and are used internally by the modules described above.

Name Description
AMASSS_CLI Perform automatic segmentation of CBCT scans
ALI-CBCT Perform automatic landmark identification of CBCT scans
ALI-IOS Perform automatic landmark identification of IOS scans
ASO-CBCT Perform automatic orientation of CBCT scans
ASO-IOS Perform automatic orientation of IOS scans
AReg-CBCT Perform automatic registration of CBCT scans
AReg-IOS Perform automatic registration of IOS scans
MRI2CBCT_ORIENT_CENTER_MRI Perform orientation and centering of MRI scans
MRI2CBCT_RESAMPLE_CBCT_MRI Perform resample of MRI and CBCT scans
MRI2CBCT_REG Perform registration of MRI-CBCT scans
FlexReg_CLI Perform creation of patch and registration on IOS scans.

Requirements

  • In addition of the Slicer System requirements, for best performance, 12GB of memory is recommended.
  • ⚠️ Trained networks are required to be manually downloaded. See requirements section specific to each module.

AMASSS Module

Extension Logo

AMASSS module will allow you to segment CBCT scan using AMASSS algortihm.

Prerequisites

Module structure

Input file: The input has to be an oriented CBCT. It can be a single CBCT scan loaded on slicer or a folder containg CBCTs with the following extention:

.nrrd / .nrrd.gz
.nii  / .nii.gz
.gipl / .gipl.gz

Available sample data for testing: MG_test_scan.nii.gz

Load models: The user has to indicate the path of the folder containing the trained models for AMASSS.

Segmentation selection: The user can choose the structure to segment using the selection table. Depending on the type of CBCT to segment, the user can select the "Use small FOV models" checkbox to use on higher definition scans. SegTab

Output option: By selecting the "Generate surface files" checkbox. The user will also get a surface model of the segmentation that will be saved in a "VTK files" folder and will be automatically loaded in slicer at the end of the prediction if working on a single file.

Advanced option:

  • You can increase/decrease the precision of the segmentation (going above 50 will drastically increase the prediction time and is not necesary worth it, going under 50 will make the prediction much faster but less accurate)
  • If the user whant to generate surface files, he can choose the smothness applied on the model.
  • Depending on your computer power, you can increase the CPU and GPU usage to increase the predictio speed.

ALI Module

Extension Logo

ALI module provide a convenient user interface allowing to identify landmarks on different type of scans:

ALI-CBCT

The implementation is based on the ALI-CBCT algortihm originally developed by Maxime Gillot at https://github.com/Maxlo24/ALI_CBCT.

Prerequisites

Module structure

Input file: The input has to be an oriented CBCT. It can be a single CBCT scan loaded on slicer or a folder containg CBCTs with the following extention:

.nrrd / .nrrd.gz
.nii  / .nii.gz
.gipl / .gipl.gz

Available sample data for testing: MG_test_scan.nii.gz

Load models: The user has to indicate the path of the folder containing the trained models for ALI-CBCT.

Landmark selection: Once the folder containing the trained models is loaded. The user can choose the landmark he want to identify with the table showing the available landmarks: SegTab


ALI-IOS

The implementation is based on the ALI-IOS algortihm originally developed by Baptiste Baquero at https://github.com/baptistebaquero/ALIDDM.

Prerequisites

Module structure

Input file: The input has to be an oriented IOS segmented with the Universal Numbering System. This segmentation can be automatically done using the SlicerJawSegmentation extention. The input can be a single IOS loaded on slicer or a folder containg IOS with the following extention: The array name of labels in the vtk surface is: "Universal_ID" or "predictionid" or "PredictionID"

.vtk

Available sample data for testing: T1_01_L_segmented.vtk and T1_01_U_segmented.vtk

Load models: The user has to indicate the path of the folder containing the trained models for ALI-IOS.

Landmark selection: For the IOS landmarks, the user has to choose which tooth he need the landmakrs on by checking the label of the tooth on the left table. Once the folder containing the trained models is loaded. The user can choose the landmark he want to identify with the table on the right showing the available landmarks: LM_tab_ios

ASO Module

If you want more information and a descriptive tutorial of this tool, take a look at this github page: Automated Standardized Orientation

Extension Logo

ASO module provide a convenient user interface allowing to orient different type of scans:

  • CBCT scan
  • IOS scan

How the module works?

2 Modes Available (Semi or Fully Automated)

  • Semi-Automated (to only run the landmark-based registration with landmark and scans as input)
  • Fully-Automated (to perform Pre Orientation steps, landmark Identification and ASO with only scans as input)
Mode Input
Semi-Automated Scans, Landmark files
Fully-Automated Scans, ALI Models, Pre ASO Models (for CBCT files), Segmentation Models (for IOS files)

Input file:

Input Type Input Extension Type
CBCT .nii, .nii.gz, .gipl.gz, .nrrd, .nrrd.gz
IOS .vtk .stl .vtp .off .obj

Test Files Available: You can either download them using the link or by using the Test Files button.

Module Selected Download Link to Test Files Information
Semi-CBCT Test Files Scan and Fiducial List for this Reference
Fully-CBCT Test File Only Scan
Semi-IOS Test Files Mesh and Fiducial List Reference
Fully-IOS Test Files Only Mesh Reference

Reference:

The user has to choose a folder containing a Reference Gold File with an oriented scan with landmarks. You can either use your own files or download ours using the Download Reference button in the module Input section.

Input Type Reference Gold Files
CBCT CBCT Reference Files
IOS IOS Reference Files

Landmark selection

The user has to decide which landmarks he will use to run ASO.

Input Type Landmarks Available
CBCT Cranial Base, Lower Bones, Upper Bones, Lower and Upper Teeth
IOS Upper and Lower Jaw

The landmark selection is handled in the Landmark Reference Section:

Models Selection

For the Fully-Automated Mode, models are required as input, use the Select Button to automatically download, extract and select the selected models.

ASOSADT

AReg Module

Extension Logo

AReg module provide a convenient user interface allowing to orient different type of scans:

  • CBCT scan
  • IOS scan

How the module works?

3 Modes Available

  • Semi-Automated (to only run the automatic registration with masks segmentation and scans as input - only for CBCT)
  • Fully-Automated (to perform the automatic registration with only scans as input)
  • Orientation and Registration (to perform the automatic orientation using ASO process and the automatic registration with only scans as input)
Mode Input
Semi-Automated (only for CBCT) Scans, Masks segmentation
Fully-Automated Scans, Segmentation Models
Orientation and Registration Scans, ALI Models (for CBCT files), Segmentation Models

For CBCT, a final step is added and consist of segmenting different skeletal structures using AMASSS process within each mode.

Input file:

Input Type Input Extension Type
CBCT .nii, .nii.gz, .gipl.gz, .nrrd, .nrrd.gz
IOS .vtk .stl .vtp .off .obj

Test Files Available: You can either download them using the link or by using the Test Files button.

Module Selected Download Link to Test Files Information
Semi-CBCT Test Files Scan and Masks segmentation
Fully-CBCT Test File Only Oriented Scan
Orientation and Registration for CBCT Test File Only Scan
Fully-IOS Test Files Only Mesh )
Orientation and Registration for IOS Test Files Only Mesh

Pipelines

CBCT - AReg Pipeline

Workflow

IOS - Patch prediction

PipelinePrediction

Some Results

ARegResult

Models Selection

For the Fully-Automated Mode, models are required as input, use the Select Button to automatically download, extract and select the selected models.

AutoCrop3D Module

Extension Logo

AutoCrop3D stands for "Scans automatically cropped" according to a Region Of Interest (ROI).

Useful Information

This module has the same utility as "Crop Volume", which offers more interactive feedbacks to the user, but "AutoCrop3D" allows you to easily trim the ROI of all the cases in your study. Then you can load your files into Slicer to view them. More Information about Crop Volume

It solves the issue of files that may be too heavy for "Crop Volume Sequence" More Information about Crop volume Sequence.

How does the module work?

Input:

Input Input Type Input Extension Type Files to Test
File or Folder CBCT .nii, .nii.gz, .gipl.gz, .nrrd, .nrrd.gz Segmentation.zip
Region of Interest* Volume .json ROI.mrk.zip

You can choose a suffix which will be added to the existing name of your file(s).

If you want to generate VTK files from your Segmentations, the Segmentation files must have "Seg" somewhere in the name. For example: patientName_Seg.nii.gz

How to create a Region Of Interest?

Use the module "Volume Rendering" to create your ROI and then save it as a .json file.

  1. Upload a scan file
  2. Choose the option Display ROI
  3. Change the ROI as you like
  4. Save it

Tuto1 Tuto2

AutoMatrix Module

Extension Logo

The AutoMatrix module provides a user interface to apply a matrix to a folder for different types of scans or segmentations:

  • CBCT
  • IOS

How the module works?

How to name the new files and where they are stored

The module will create the same path you had in the input folder in the output folder. The new files will be named by the name of the original file + the suffix you entered + the name of the matrix files that were applied.

Example : Input file : patient1_T1_MA.nii.gz Input matrix : patient1_matrix1.tfm Input suffix : _apply Output file : patient1_T1_MA_apply_matrix1.nii.gz

4 Modes available

Sometimes a LinkName is required. See the information below.

Mode Download Link to Test Files Information
File patient and file matrix Test Files LinkName is not required. The matrix is applied to the input file. This new file is save in the output folder.
File patient and folder matrix Test Files LinkName required. For each matrix applied, a new file is created.
Folder patient and file matrix Test Files LinkName is not required. The matrix will be applied to all files in the input folder.
Folder patient and folder matrix Test Files LinkName required. For each matrix applied, a new file is created. You can have more than one file with the same patient name.

When a LinkName is required :

The name of the matrix files and the name of the seg/scan files must begin with the same patient name. After the patient name, you must put and underscore before any other information. Example : Name file patient : patient1_T1_MA.nii.gz Name matrix files : patient1_left_MA.tfm

Mirror :

There is button "Mirror" that will automatically download the matrix mirror and put in input.

Input file:

Input Type Input Extension Type Input Matrix Extension
CBCT .nii.gz .tfm .npy .h5 .mat .txt
IOS .vtk .stl .vtp .off .obj .tfm .npy .h5 .mat .txt

MRI2CBCT Module

The MRI2CBCT module provides a user interface to perform the registration between MRI and CBCT scans.

How does the module work?

Preprocessing Step:

  1. Orient and Center CBCT:

    • Input: CBCT folder path
    • Download Models: You can download the models required for segmentation and orientation by clicking on "Download."
  2. Orient and Center MRI:

    • Input: MRI folder path
    • Axis Direction: You need to choose the new direction for each axis.
  3. Resample:

    • Options: You can choose to resample both MRI and CBCT, just MRI, or just CBCT.
    • Slice/Number of Slices: Decide the new slices/number of slices or retain the same size as before running it.
    • Spacing: Choose the new spacing or keep the same spacing as in the input.

Manual Approximation and Cropping:

Before running the normalization, the user needs to perform a manual approximation and cropping on the same region for the MRI, CBCT, and CBCT segmentation. For the cropping, the user can use AutoCrop3D available in this extension.

Registration:

  • Inputs: CBCT, CBCT segmentation, and MRI scans after completing the preprocessing steps, including manual approximation and cropping.
  • Normalization Options: Select the normalization method and specify the percentile to apply to both MRI and CBCT scans. Default values are provided for convenience.

FlexReg Module

FlexReg is a module that allows you to register patient-specific Intra Oral Scans. It lets you create custom patches for registration.

How does the module work?

  1. Load your files:

    • Choose your path by clicking on "Select" and load it by clicking on "View".
  2. Draw your own patch:

    • Butterfly Patch:
      • You can draw a butterfly patch using the parameters and select your own teeth. Note that this patch, with the default values, is called “ButterflyPatch” and is created when you run AREG_IOS:

        Butterfly Patch Image

    • Custom Patch:
      • You can draw the patch using landmarks and customize it:
      • Patch landmarks

    • You can combine multiple patches by creating them one by one. All your patches will be used as a single patch for the registration.
    • Multiple patchs

  3. Registration:

    • After creating your patch for both the fixed and moving scans, choose the output folder and the suffix you would like. If you have a lower arch to move, you can select it.
    • Register them by clicking on "Registration".

Acknowledgements

Authors: Maxime Gillot (University of Michigan), Baptiste Baquero (UoM), Luc Anchling (UoM), Nathan Hutin (UoM),Jeanne Claret (UoM),Gaelle Leroux (UoM), Lucia Cevidanes (UoM), Juan Carlos Prieto (UNC), David Allemang (Kitware), Jean-Christophe Fillion-Robin (Kitware), Connor Bowley (Kitware), James Butler (Kitware).

Supported by NIDCR R01 024450, AA0F Grabber Family Teaching and Research Award and by Research Enhancement Award Activity 141 from the University of the Pacific, Arthur A. Dugoni School of Dentistry.

License

This software is licensed under the terms of the Apache Licence Version 2.0.

slicerautomateddentaltools's People

Contributors

allemangd avatar baptistebaquero avatar cmfsx avatar gaelleleroux avatar hutin1 avatar jcfr avatar jeanneclre avatar juanprietob avatar lucanchling avatar luciacev avatar maxlo24 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

slicerautomateddentaltools's Issues

libraries for slicer automated dental tools

Hello,

I have installed Window 11, 3D Slicer 5.6.1 and the most recent version of the slicer automated dental tools extension.
I tried to use AMASSS.
After Run prediction I get the following message.

image

After clicking on the yes button, the python console shows:

ERROR: Could not find a version that satisfies the requirement torch==cu118 (from versions: 1.7.1, 1.8.0, 1.8.1, 1.9.0, 1.9.1, 1.10.0, 1.10.1, 1.10.2, 1.11.0, 1.12.0, 1.12.1, 1.13.0, 1.13.1, 2.0.0, 2.0.1, 2.1.0, 2.1.1, 2.1.2, 2.2.0)
ERROR: No matching distribution found for torch==cu118
Traceback (most recent call last):
File "C:/Users/Gebruiker/AppData/Local/slicer.org/Slicer 5.6.1/slicer.org/Extensions-32438/SlicerAutomatedDentalTools/lib/Slicer-5.6/qt-scripted-modules/AMASSS.py", line 684, in onPredictButton
libs_installation = install_function(list_libs)
File "C:/Users/Gebruiker/AppData/Local/slicer.org/Slicer 5.6.1/slicer.org/Extensions-32438/SlicerAutomatedDentalTools/lib/Slicer-5.6/qt-scripted-modules/AMASSS.py", line 81, in install_function
pip_install(lib_version)
File "C:\Users\Gebruiker\AppData\Local\slicer.org\Slicer 5.6.1\bin\Python\slicer\util.py", line 3887, in pip_install
_executePythonModule("pip", args)
File "C:\Users\Gebruiker\AppData\Local\slicer.org\Slicer 5.6.1\bin\Python\slicer\util.py", line 3848, in _executePythonModule
logProcessOutput(proc)
File "C:\Users\Gebruiker\AppData\Local\slicer.org\Slicer 5.6.1\bin\Python\slicer\util.py", line 3814, in logProcessOutput
raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)
subprocess.CalledProcessError: Command '['C:/Users/Gebruiker/AppData/Local/slicer.org/Slicer 5.6.1/bin/../bin\PythonSlicer.EXE', '-m', 'pip', 'install', 'torch==cu118']' returned non-zero exit status 1.

How can I make changes to the libraries?

Adrian

Root Canal Segmentation

Hello Github community,

Can anyone suggest me an extension for root canal segmentation in 3d slicer software

Teeth segmentation

Will there also be a model for teeth segmentation, as it's missing for a complete tool?

AMASSS working problem

Hello everyone,I recently downloaded the automated dental tools. Although when I use AMASSS module and enter the input data and choose the output data and click on run prediction the software doesn’t respond. I don’t know what is the problem? However when I tried older versions like slicer 5.0.2 and 4.11 and when I press on run prediction it calculate the time and then stopped without any result.
Any clue or better alternative?
these are two different versions of 3d slicer software
8f1ac52aad6d5a0d954eb69f6d7610f1ef6750f5
4d1bd2fcdc9b76deac59a7906c0679b5434b1622

Thanks in advance

Update README to improve readability

  • Add dedicated Features section
  • Fix list of modules
  • Considering removing list of authors and instead add a dedicated Acknowledgements section
  • Tweak Requirements section
  • Add Prerequisites sections
  • Introduce acronyms like IOS
  • Use sections like Panels and their use and Use cases for each module (see example in Slicer at Docs/user_guide/modules). For example, see transforms. Browsing the Slicer modules documentation will help find relevant examples.

List of Modules

Consider updating this section

- segment CBCT scan using [AMASSS](https://github.com/Maxlo24/AMASSS_CBCT)
- Identify landmarks in CBCT using [ALI-CBCT](https://github.com/Maxlo24/ALI_CBCT)
- Identify landmarks in IOS using [ALI-IOS](https://github.com/baptistebaquero/ALIDDM)

adding link to #amasss-module and #ali-module. Referencing the repository implementing the method there will likely confuse the reader.

Consider looking at this README for an example:
https://github.com/KitwareMedical/SlicerPipelines/blob/main/README.md

Requirements section

* In addition of the [Slicer System requirements](https://slicer.readthedocs.io/en/latest/user_guide/getting_started.html#system-requirements), for best performance, 12GB of memory is recommended.
* :warning: Trained networks are required to be manually downloaded. See requirements section specific to each module.

Prerequisites sections

  • Add dedicated Prerequisites sections for each module (the current section called Load models should then be updated.

SlicerAutomatedDentalTools Extension Not Available in Slicer 5.6.1 Stable and Nightly Builds

@allemangD @bpaniagua @jcfr @lassoan

Issue Description

Extension Name: SlicerAutomatedDentalTools
Affected Slicer Version: 5.6.1 Stable and Nightly Builds
Operating Systems: Linux, Windows, Mac

Problem

The SlicerAutomatedDentalTools extension, which includes modules for Automated CBCT and Intra-oral Scans (such as AOS, AReg, AMASSS, AutoMatrix, and AutoCrop3D), is not available for download in the Slicer 5.6.1 stable version nor in the nightly builds since last week. This extension is critical for our workflows, and its absence in the latest versions is impacting our operations.

Expected Behavior

In previous versions (e.g., Slicer 5.6), this extension was available and functional. We expect the extension to be accessible and operational in both the Slicer 5.6.1 stable release and the nightly versions.

Steps to Reproduce

  1. Open 3D Slicer version 5.6.1 (stable or nightly build).
  2. Navigate to the Extension Manager.
  3. Search for "SlicerAutomatedDentalTools".
  4. Observe that the extension does not appear in the search results.

Additional Information

Request

We request assistance in resolving this issue to ensure that the SlicerAutomatedDentalTools extension is available and functional in Slicer 5.6.1 stable and nightly builds. Any guidance on troubleshooting or timelines for a resolution would be greatly appreciated.


Thank you for your attention to this matter and for your support in maintaining the functionality of essential extensions within the Slicer community.

bug report: export landmark to json, the node value keep the same, and are wrong

           {
                "id": "12",
                "label": "RNC",
                "description": "",
                "associatedNodeID": "",
                "position": "",
                "orientation": [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0],
                "selected": true,
                "locked": true,
                "visibility": true,
                "positionStatus": "preview"
            },
            {
                "id": "13",
                "label": "ROr",
                "description": "",
                "associatedNodeID": "",
                "position": "",
                "orientation": [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0],
                "selected": true,
                "locked": true,
                "visibility": true,
                "positionStatus": "preview"
            },
            {
                "id": "14",
                "label": "RPF",
                "description": "",
                "associatedNodeID": "",
                "position": "",
                "orientation": [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0],
                "selected": true,
                "locked": true,
                "visibility": true,
                "positionStatus": "preview"
            },
            {
                "id": "15",
                "label": "UL1O",
                "description": "",
                "associatedNodeID": "",
                "position": "",
                "orientation": [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0],
                "selected": true,
                "locked": true,
                "visibility": true,
                "positionStatus": "preview"
            },

above is part of landmark json file

RuntimeError: DataLoader worker (pid(s) 22552) exited unexpectedly

I tried running the extension on two separate devices, bone with GTX 1070ti and other with RTX 3050. Both gave the same error.
Here is the error that i get in the python console.

Loading scan : C:/Users/frida/OneDrive/Desktop/CBCT/MG_test_scan.nii.gz
Correcting scan contrast : C:/Users/frida/OneDrive/Desktop/CBCT/MG_test_scan.nii.gz
Importing librairies...
No module named 'logic'
Found existing installation: monai 0.7.0
Uninstalling monai-0.7.0:
ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\lib\Python\Lib\shutil.py", line 815, in move
os.rename(src, real_dst)
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'c:\users\frida\appdata\local\slicer.org\slicer 5.3.0-2023-03-27\lib\python\lib\site-packages\monai-0.7.0.dist-info\' -> 'C:\Users\frida\AppData\Local\Temp\pip-uninstall-gg2psnif\monai-0.7.0.dist-info'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\lib\Python\Lib\site-packages\pip_internal\cli\base_command.py", line 160, in exc_logging_wrapper
status = run_func(*args)
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\lib\Python\Lib\site-packages\pip_internal\commands\uninstall.py", line 105, in run
uninstall_pathset = req.uninstall(
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\lib\Python\Lib\site-packages\pip_internal\req\req_install.py", line 664, in uninstall
uninstalled_pathset.remove(auto_confirm, verbose)
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\lib\Python\Lib\site-packages\pip_internal\req\req_uninstall.py", line 373, in remove
moved.stash(path)
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\lib\Python\Lib\site-packages\pip_internal\req\req_uninstall.py", line 271, in stash
renames(path, new_path)
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\lib\Python\Lib\site-packages\pip_internal\utils\misc.py", line 312, in renames
shutil.move(old, new)
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\lib\Python\Lib\shutil.py", line 835, in move
copy_function(src, real_dst)
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\lib\Python\Lib\shutil.py", line 444, in copy2
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\lib\Python\Lib\shutil.py", line 264, in copyfile
with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: 'c:\users\frida\appdata\local\slicer.org\slicer 5.3.0-2023-03-27\lib\python\lib\site-packages\monai-0.7.0.dist-info\'

========= ERROR =========

CLI execution failed:

Traceback (most recent call last):
File "", line 1, in
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\lib\Python\Lib\multiprocessing\spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\lib\Python\Lib\multiprocessing\spawn.py", line 125, in _main
prepare(preparation_data)
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\lib\Python\Lib\multiprocessing\spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\lib\Python\Lib\multiprocessing\spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\lib\Python\Lib\runpy.py", line 268, in run_path
return _run_module_code(code, init_globals, run_name,
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\lib\Python\Lib\runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\lib\Python\Lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\slicer.org\Extensions-31693\SlicerAutomatedDentalTools\lib\Slicer-5.3\cli-modules\AMASSS_CLI.py", line 71, in
pip_uninstall('monai')
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\bin\Python\slicer\util.py", line 3622, in pip_uninstall
_executePythonModule('pip', args)
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\bin\Python\slicer\util.py", line 3548, in _executePythonModule
logProcessOutput(proc)
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\bin\Python\slicer\util.py", line 3517, in logProcessOutput
raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)
subprocess.CalledProcessError: Command '['C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\bin/PythonSlicer.exe', '-m', 'pip', 'uninstall', 'monai', '--yes']' returned non-zero exit status 2.
Traceback (most recent call last):
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\lib\Python\Lib\site-packages\torch\utils\data\dataloader.py", line 1133, in _try_get_data
data = self._data_queue.get(timeout=timeout)
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\lib\Python\Lib\multiprocessing\queues.py", line 114, in get
raise Empty
_queue.Empty

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\slicer.org\Extensions-31693\SlicerAutomatedDentalTools\lib\Slicer-5.3\cli-modules\AMASSS_CLI.py", line 1220, in
main(args)
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\slicer.org\Extensions-31693\SlicerAutomatedDentalTools\lib\Slicer-5.3\cli-modules\AMASSS_CLI.py", line 908, in main
for step, batch in enumerate(pred_loader):
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\lib\Python\Lib\site-packages\torch\utils\data\dataloader.py", line 634, in next
data = self._next_data()
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\lib\Python\Lib\site-packages\torch\utils\data\dataloader.py", line 1329, in _next_data
idx, data = self._get_data()
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\lib\Python\Lib\site-packages\torch\utils\data\dataloader.py", line 1295, in _get_data
success, data = self._try_get_data()
File "C:\Users\frida\AppData\Local\slicer.org\Slicer 5.3.0-2023-03-27\lib\Python\Lib\site-packages\torch\utils\data\dataloader.py", line 1146, in _try_get_data
raise RuntimeError('DataLoader worker (pid(s) {}) exited unexpectedly'.format(pids_str)) from e
RuntimeError: DataLoader worker (pid(s) 22552) exited unexpectedly

AMASSS: Metal and osteotomies in scans

Hello, I observed thst AMASSS is struggling with metal in the scans. For example metal plates used for orthognatic surgery and also with the osteotomies itself.

Is there any chance, that AMASSS will be trained at some time with scans with plates and osteotomies?

It would make it more useful for comparing the intended outcome of orthognatic surgery with the pre surgery scans.

Documentation: Workaround for Extension often not showing up in the Extension Manager

Hello,

most of the time you don't see the Automated Dental Tools extension in the extension manager because it hasn't been built for the specific version. Maybe the process for getting the last Slicer version where the extensions have been successfully built should be documented in the README.md.

The current workaround is to go to the build dashboard and search for the build name "AutomatedDentalTools" and find a version without errors (stable/preview).

Currently the last correctly build version i find is revision 32390 from Nov 28th 2023: See in dashboard

Then you have to download the correct revision of slicer (see Slicer documentation).

For my example the Windows release v5.6.0 Revision 32390 can be downloaded with this link: http://download.slicer.org/download?os=win&stability=any&revision=32390

With that Slicer executable you should see the extension in the extension manager.

Regards,
Tedd

AMASSS: Possible fix for CUDA memory issue (torch.cuda.OutOfMemoryError: CUDA out of memory)

Hi there,

as other people in this thread I am dealing with the CUDA running out of GPU memory (already reported in issue #17).

torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 2.04 GiB (GPU 0; 8.00 GiB total capacity; 5.17 GiB already allocated; 673.43 MiB free; 5.30 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

The concrete exception happens when the function sliding_window_inference is called in AMASSS_CLI.py Line 976.

In a Project MONAI issue (Project-MONAI/MONAI#1189) I found, that it is possible to use GPU computation but CPU memory by replacing

val_outputs = sliding_window_inference(input_img, cropSize, args["nbr_GPU_worker"], net,overlap=args["precision"])

by

val_outputs = sliding_window_inference(input_img, cropSize, args["nbr_GPU_worker"], net,overlap=args["precision"], sw_device="cuda", device="cpu")

in AMASS_CLI.py.

I have just tested it and now I am able to segment everything on a NVIDIA GeForce GTX 1060 6GB without any crashs due to no memory.

On a machine with Intel Core i7-6700 3.4 GHz CPU with 16GB memory and a NVIDIA GeForce GTX 1060 6GB a CBCT scan with a 0.4mm resolution took 780.25 seconds to segment (mandible, maxilla, cranial base and skin).

Can someone check and confirm the fix, please?

Thanks,
Tedd

ALI doesn't install

Greetings,

I hope this message finds you well. I'm currently utilizing version 5.6.1 of Slicer, and I've recently installed the latest Automated Dental Tools extension. However, I've noticed that the ALI panel isn't appearing in the Slicer menu as expected. It seems that it may not have installed automatically.

Best regards, Juan
Captura de pantalla 2024-04-05 175522

how to specify library Versions for ITK and ITK-elastix libraries

@allemangD @jcfr @bpaniagua @lassoan @pieper @juanprietob

Issue Description:
The AREG module within the SlicerAutomatedDentalTools extension is currently experiencing issues with the latest versions of ITK and ITK-elastix libraries. It appears to rely on specific library versions, specifically ITK 5.3.0 and ITK-elastix 0.17.1 (with a test compatibility with SimpleITK version 2.2.1).

Context:
We need to ensure that specifying library versions doesn't lead to conflicts with other extensions. Therefore, I am seeking guidance on the best practices for specifying the required library versions for AREG to ensure smooth functionality without interfering with other extensions.

Request for Guidance:
Please suggest a recommended approach for specifying the required versions of ITK, ITK-elastix, and possibly SimpleITK within the context of a Slicer extension.

Given the holiday break, I understand that responses may be delayed. Any guidance or pointers on how to proceed in the New Year would be greatly appreciated. Thank you for your assistance in addressing this issue. It will help ensure the smooth operation of the AREG extension and its compatibility with the broader Slicer ecosystem.

Consistently name Python packages supporting modules

I suggest to standardize on American English and perform the following renaming 1:

Current name Proposed name
ALI_IOS/utils_windows ALI_IOS/ALI_IOS_utils
AREG/AREG_Methode AREG/AREG_utils
AutoMatrix/Methode AutoMatrix/AutoMatrix_utils

Footnotes

  1. Without forgetting to rename references in CMakeLists.txt and python scripts

List of available ALI landmarks in documentation

Hello,

some people are unsure about the definition of some ALI landmarks (for example the ones ending with an O). In the documentation there also seems to be no list of landmarks and definitions available.

Can you please add a list of definitions to the ALI Models section? Possibly also add them to the ALI Qt GUI.

Associate tooltip with buttons

For example, the following should give a hint to the user:

<item>
<widget class="QPushButton" name="DownloadScanButton">
<property name="text">
<string>Download test scan</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="DownloadButton">
<property name="text">
<string>Download latest models</string>
</property>

Mousing over Download latest model should indicate something like Initiate download of the trained model (> 1GB) using an URL opened in default system browser

Same comment for button Download test scan

README: Consider referencing some sample data

To allow Slicer users & developers to test the extension, consider referencing sample data in the README.

To further streamline the experience, you could even consider registering custom sample data in your modules. For example, see here

Consider using latest `monai` version

Currently if monai is not found in Slicer, the CLI are specifying to install version 0.7.0 (released Sept 2021). As of adding this extension to the Slicer extensions index, monai is now at version 0.9.1. Since monai is getting lots of updates it would be great to stay on top of using the latest versions for future improvements.

try :
from monai.networks.nets import UNETR
except ImportError:
pip_install('monai==0.7.0')
from monai.networks.nets import UNETR

try :
from monai.networks.nets import UNETR
except ImportError:
pip_install('monai==0.7.0')
from monai.networks.nets import UNETR

try :
from monai.networks.nets import UNETR
except ImportError:
pip_install('monai==0.7.0')
from monai.networks.nets import UNETR

How to start?

This extension looks very useful. Unfortunately I could not figure out how it is supposed to be used.

I've downloaded the Masks_Models.zip model, unzipped and loaded the CBCT dental surgery sample data set, selected "PreDentalSurgery" as "Select node". and clicked "Run Prediction". UnERROR: Nothing happened.

Python console shows this error:

Traceback (most recent call last):
  File "C:/Users/andra/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/SlicerAutomatedDentalTools/lib/Slicer-5.2/qt-scripted-modules/AMASSS.py", line 630, in onPredictButton
    if os.path.isfile(self.input_path):
  File "C:\Users/andra/AppData/Local/NA-MIC/Slicer 5.2.1/bin/../lib/Python/Lib\genericpath.py", line 30, in isfile
    st = os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

Traceback leaving ALI module

If I first go into the ALI module, then second enter another module such as the ALI_CBCT or ALI_IOS module I observe the following traceback error in the python console.

Traceback (most recent call last):
  File "C:/S5R/Slicer-build/NA-MIC/Extensions-31085/SlicerAutomatedDentalTools/lib/Slicer-5.1/qt-scripted-modules/ALI.py", line 796, in exit
    self.removeObserver(self._parameterNode, vtk.vtkCommand.ModifiedEvent, self.updateGUIFromParameterNode)
  File "C:\S5R\Slicer-build\bin\Python\slicer\util.py", line 2481, in removeObserver
    events = self.__observations[obj]
  File "C:\S5R\python-install\Lib\weakref.py", line 416, in __getitem__
    return self.data[ref(key)]
TypeError: cannot create weak reference to 'NoneType' object

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.