dcbia-ortholab / slicerautomateddentaltools Goto Github PK
View Code? Open in Web Editor NEWA 3D Slicer extension to use AMASSS, ALI-CBCT and ALI-IOS
License: Other
A 3D Slicer extension to use AMASSS, ALI-CBCT and ALI-IOS
License: Other
How use the code?
I can't start the UI
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.
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.
Features
sectionAcknowledgements
sectionRequirements
sectionPrerequisites
sectionsIOS
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.Consider updating this section
SlicerAutomatedDentalTools/README.md
Lines 12 to 14 in 5c13f99
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
There is no need to specify Slicer 5.1.0 or later
as the extension will be available on the relevant Slicer version. Instead, you could consider adding a History
section mentioning that the extension was first introduced in Slicer 5.1.0
. For an example of history sections, see:
Consider text like the following
* 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 for each module (the current section called Load models
should then be updated.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
The link here is invalid. Where else may I download this model? Thanks
{
"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
@allemangD @bpaniagua @jcfr @lassoan
Extension Name: SlicerAutomatedDentalTools
Affected Slicer Version: 5.6.1 Stable and Nightly Builds
Operating Systems: Linux, Windows, Mac
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.
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.
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.
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
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
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
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.
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
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.
For example, the following should give a hint to the user:
SlicerAutomatedDentalTools/AMASSS/Resources/UI/AMASSS.ui
Lines 176 to 187 in 5c13f99
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
Packages should NOT be installed simply after importing the script.
Additionally, the user should be notified that their installation will be modified and offered the option to opt-out.
I have found it not able to get the module to work on Garuda Linux and Slicer 5.5.0-2023-09-13 r32175 / 23bf4eb. Please point me to a way to get this corrected.
Is this leftover example code or are you actually trying to utilize this logic package from PyPI? I'm observing when running the CLIs No module named 'logic'
.
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 |
Without forgetting to rename references in CMakeLists.txt
and python scripts ↩
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
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
@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.
Will there also be a model for teeth segmentation, as it's missing for a complete tool?
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
Thanks in advance
Suggested changes:
- Input Type
+ Input Modality
- Input
+ Input Type
- File as input
+ Node
- Directory as input
+ Directory
Good evening,
I am YOU, I am working in a project segmented the The whole bone of the scalp I am trying to follow the Tutorial video by DCBIA.
But it did not work. I also find it hard to insert data in Model's Folder which I cannot do the same is video Tutorial
https://www.youtube.com/watch?v=d6penNStUQE
https://www.youtube.com/watch?v=Sg6oaOclOV8&t=174s
Please could anyone tell me how to solve this problem?
Best regard,
YOU
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.
SlicerAutomatedDentalTools/ALI_CBCT/ALI_CBCT.py
Lines 71 to 75 in 5c13f99
SlicerAutomatedDentalTools/ALI_IOS/ALI_IOS.py
Lines 64 to 68 in 5c13f99
SlicerAutomatedDentalTools/AMASSS_CLI/AMASSS_CLI.py
Lines 70 to 74 in 5c13f99
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
as descriped, I use 2080ti 12GB GPU, how can I adjust this param?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.