ExtensionsIndex icon indicating copy to clipboard operation
ExtensionsIndex copied to clipboard

ENH: New extension: Slicer_ASLtoolkit

Open acsenrafilho opened this issue 1 year ago • 6 comments

New extension

  • [x] Extension has a reasonable name (not too general, not too narrow, suggests what the extension is for)
  • [x] Repository name is Slicer+ExtensionName
  • [x] Repository is associated with 3d-slicer-extension GitHub topic so that it is listed here. To edit topics, click the settings icon in the right side of "About" section header and enter 3d-slicer-extension in "Topics" and click "Save changes". To learn more about topics, read https://help.github.com/en/articles/about-topics
  • [x] Extension description summarizes in 1-2 sentences what the extension is usable (should be understandable for non-experts)
  • [x] Any known related patents must be mentioned in the extension description.
  • [x] LICENSE.txt is present in the repository root. MIT (https://choosealicense.com/licenses/mit/) or Apache (https://choosealicense.com/licenses/apache-2.0/) license is recommended. If source code license is more restrictive for users than MIT, BSD, Apache, or 3D Slicer license then the name of the used license must be mentioned in the extension description.
  • [x] Extension URL and revision (scmurl, scmrevision) is correct, consider using a branch name (main, release, ...) instead of a specific git hash to avoid re-submitting pull request whenever the extension is updated
  • [x] Extension icon URL is correct (do not use the icon's webpage but the raw data download URL that you get from the download button - it should look something like this: https://raw.githubusercontent.com/user/repo/main/SomeIcon.png)
  • [x] Screenshot URLs (screenshoturls) are correct, contains at least one
  • [x] Homepage URL points to valid webpage containing the following:
    • [x] Extension name
    • [x] Short description: 1-2 sentences, which summarizes what the extension is usable for
    • [x] At least one nice, informative image, that illustrates what the extension can do. It may be a screenshot.
    • [x] Description of contained modules: at one sentence for each module
    • [x] Tutorial: step-by-step description of at least the most typical use case, include a few screenshots, provide download links to sample input data set
    • [x] Publication: link to publication and/or to PubMed reference (if available)
    • [x] License: We suggest you use a permissive license that includes patent and contribution clauses. This will help protect developers and ensure the code remains freely available. We suggest you use the Slicer License or the Apache 2.0. Always mention in your README file the license you have chosen. If you choose a different license, explain why to the extension maintainers. Depending on the license we may not be able to host your work. Read here to learn more about licenses.
    • [x] Content of submitted json file is consistent with the top-level CMakeLists.txt file in the repository (dependencies, etc. are the same)
  • Hide unused features in the repository to reduce noise/irrelevant information:
    • [x] Click Settings and in repository settings uncheck Wiki, Projects, and Discussions (if they are currently not used)
    • [x] Click the settings icon next to About in the top-right corner of the repository main page and uncheck Releases and Packages (if they are currently not used)

acsenrafilho avatar Nov 07 '24 15:11 acsenrafilho

@lassoan could you please evaluate this PR as well?

acsenrafilho avatar Nov 16 '24 15:11 acsenrafilho

There is no CLI modules, so you cannot ask the user about installing a Python package. It is OK to install without asking, like this:

try:
    from asltk.asldata import ASLData
    from asltk.reconstruction import CBFMapping
    from asltk.utils import load_image, save_image
except ModuleNotFoundError:
    import slicer.util
    slicer.util.pip_install("asltk")
    from asltk.asldata import ASLData
    from asltk.reconstruction import CBFMapping
    from asltk.utils import load_image, save_image

I could not try to actually use any of the modules, because I could not find any tutorial with testing data.

lassoan avatar Nov 16 '24 17:11 lassoan

Great, @lassoan Thanks for the advice. I did not know that, for extensions without CLI, it is ok to install the python package directly. I have changed the code lines in the main branch Link to ASL sample

BTW, I have also added a small data test zip file here to assist with a (brief) testing. I will also add this example test data to the documentation, which will be publicly available to users and developers.

acsenrafilho avatar Nov 19 '24 19:11 acsenrafilho

@lassoan , just to say that I have updated the extension documentation to give a quick dataset tutorial to assist for further testing. See more details in the section Quick tutorial in the documentation

I already included the How to install section assuming that (soon) this extension will be live at Slicer Extension Manager (finger crossed 🤞 )

I hope that this will be useful for the general community. Any thoughts are very welcome!

BTW, thank you very much for all the help!

acsenrafilho avatar Nov 22 '24 00:11 acsenrafilho

Thank you for your patience. Have you tried if slicer.util.messageBox actually works in Python CLI modules? I would expect it to fail. It is because that GUI CLI modules are not meant to provide any interactivity or GUI (other than the GUI that is automatically generated from the .xml file). If there is any message that you want to display to the user then print it to the standard output or standard error. If there is an error then exit with a non-zero exit code.

lassoan avatar Dec 10 '24 02:12 lassoan

Hi @lassoan

Thank you for the suggestion. I made the change in the print messages, using the direct standard output. All the slicer.util.messagebox and similar methods were replaced to be print out as usual.

Is there anything else to be adjusted?

Thank you again for all the tips!

acsenrafilho avatar Jan 21 '25 17:01 acsenrafilho

Hi @jcfr

I am wondering if it is needed to ajust more details in the PR. Is it ok to be merged?

Please tell me what are the further adjustments to be done (if there is any).

Thank you!

acsenrafilho avatar Sep 01 '25 16:09 acsenrafilho

It should be good, only the extension name and category needs some attention.

❌ Check extension name failed: extension name should not start with 'Slicer'. Please, consider changing it to '_ASLtoolkit'.

Could you update the project name in the top-level CMakeLists.txt file to be ASLToolkit (or maybe ASLtoolkit)? It is good to have the Slicer prefix in the repository name, but not in the extension's name.

❌ Check category failed: Category Arterial Sping Labelling is unknown. Consider using any of the known extensions instead: Active Learning, Analysis, Auto3dgm, BigImage, Cardiac, Chest Imaging Platform, Conda, Converters, DICOM, DSCI, Developer Tools, Diffusion, Examples, Exporter, FTV Segmentation, Filtering, Filtering.Morphology, Filtering.Vesselness, Holographic Display, IGT, Informatics, Netstim, Neuroimaging, Nuclear Medicine, Orthodontics, Osteotomy Planning, Otolaryngology, Photogrammetry, Pipelines, Planning, Printing, Quantification, Radiotherapy, Registration, Remote, Rendering, SPHARM, Segmentation, Sequences, Shape Analysis, Shape Regression, Shape Visualization, Simulation, SlicerCMF, SlicerMorph, Spectral Imaging, Supervisely, Surface Models, SurfaceLearner, Tomographic Reconstruction, Tracking, Tractography, Training, Ultrasound, Utilities, Vascular Modeling Toolkit, Virtual Reality, VisSimTools, Web System Tools, Wizards

Would any of these existing categories work for your extension?

lassoan avatar Sep 07 '25 01:09 lassoan

It should be good, only the extension name and category needs some attention.

❌ Check extension name failed: extension name should not start with 'Slicer'. Please, consider changing it to '_ASLtoolkit'.

Could you update the project name in the top-level CMakeLists.txt file to be ASLToolkit (or maybe ASLtoolkit)? It is good to have the Slicer prefix in the repository name, but not in the extension's name.

❌ Check category failed: Category Arterial Sping Labelling is unknown. Consider using any of the known extensions instead: Active Learning, Analysis, Auto3dgm, BigImage, Cardiac, Chest Imaging Platform, Conda, Converters, DICOM, DSCI, Developer Tools, Diffusion, Examples, Exporter, FTV Segmentation, Filtering, Filtering.Morphology, Filtering.Vesselness, Holographic Display, IGT, Informatics, Netstim, Neuroimaging, Nuclear Medicine, Orthodontics, Osteotomy Planning, Otolaryngology, Photogrammetry, Pipelines, Planning, Printing, Quantification, Radiotherapy, Registration, Remote, Rendering, SPHARM, Segmentation, Sequences, Shape Analysis, Shape Regression, Shape Visualization, Simulation, SlicerCMF, SlicerMorph, Spectral Imaging, Supervisely, Surface Models, SurfaceLearner, Tomographic Reconstruction, Tracking, Tractography, Training, Ultrasound, Utilities, Vascular Modeling Toolkit, Virtual Reality, VisSimTools, Web System Tools, Wizards

Would any of these existing categories work for your extension?

Hi @lassoan

Great, I will make the change in the extension name to remove the Slicer prefix. No problem.

However, regarding the Arterial Sping Labelling category, this still a doubt to me. Is it possible to us to create a new category to ASL (Arterial Sping Labelling) topic? In the list provided in Slicer at the moment, this category is not availble and (in my point of view) it could be nice to include this new topic in MRI analysis (as Diffusion that is already present). What do you think about it? Anyway, if it is not able to create a new category for ASL, I think that it could fit into the Analysis or Neuroimaging. What would be appropriate?

Thank you again for the revision in the PR and all the help!

acsenrafilho avatar Sep 11 '25 12:09 acsenrafilho

In the long term we should probably switch to using multiple "tags" to filter and categorize extensions. But for now, to make the single "category" field useful, we need categories that contain more than a few extensions, but not dozens.

How many extensions could go into the "Arterial Spin Labeling" category?

lassoan avatar Sep 11 '25 12:09 lassoan

I see and agree with you @lassoan. At the moment, I am making the initial development for Slicer in the field of ASL processing. But, maybe in the future, new research groups can enroll to Slicer community and try to add new extension in this area (but it is unclear to me how far this would go...)

In any case, considering that it is in the Slicer planning to add a multiple tag in the future, I could place an exisiting category now and then update it in the future.

If this is good to go, I can make the adjsutment in the code here.

Thanks!

acsenrafilho avatar Sep 11 '25 12:09 acsenrafilho

Hi, @lassoan

I have made the changes in the extension name and category and CI have checked successfuly.

Is anything else needed ?

Thank you again for the support

acsenrafilho avatar Sep 18 '25 12:09 acsenrafilho

Thank you, everything looks good!

Just a few things to consider:

  1. I've tried the test data provided at the link and it resulted in computation errors:
No module named 'logic'
Collecting asltk>=0.7.1<1.0.0
  Downloading asltk-0.7.1-py3-none-any.whl.metadata (4.3 kB)
Collecting SimpleITK<3.0.0,>=2.4.0 (from asltk>=0.7.1<1.0.0)
  Downloading simpleitk-2.5.2-cp39-cp39-win_amd64.whl.metadata (7.3 kB)
Collecting antspyx<0.6.0,>=0.5.4 (from asltk>=0.7.1<1.0.0)
  Downloading antspyx-0.5.4-cp39-cp39-win_amd64.whl.metadata (6.7 kB)
Collecting dill<0.4.0,>=0.3.9 (from asltk>=0.7.1<1.0.0)
  Using cached dill-0.3.9-py3-none-any.whl.metadata (10 kB)
Collecting kagglehub<0.4.0,>=0.3.12 (from asltk>=0.7.1<1.0.0)
  Downloading kagglehub-0.3.13-py3-none-any.whl.metadata (38 kB)
Requirement already satisfied: numpy<2.0.0,>=1.22.4 in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from asltk>=0.7.1<1.0.0) (1.26.4)
Collecting pybids<0.18.0,>=0.17.2 (from asltk>=0.7.1<1.0.0)
  Downloading pybids-0.17.2-py3-none-any.whl.metadata (8.0 kB)
Collecting rich<14.0.0,>=13.8.1 (from asltk>=0.7.1<1.0.0)
  Using cached rich-13.9.4-py3-none-any.whl.metadata (18 kB)
Requirement already satisfied: scipy<2.0.0,>=1.13.1 in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from asltk>=0.7.1<1.0.0) (1.13.1)
Requirement already satisfied: pandas in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from antspyx<0.6.0,>=0.5.4->asltk>=0.7.1<1.0.0) (2.3.2)
Requirement already satisfied: pyyaml in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from antspyx<0.6.0,>=0.5.4->asltk>=0.7.1<1.0.0) (6.0.2)
Collecting statsmodels (from antspyx<0.6.0,>=0.5.4->asltk>=0.7.1<1.0.0)
  Downloading statsmodels-0.14.5-cp39-cp39-win_amd64.whl.metadata (9.8 kB)
Collecting webcolors (from antspyx<0.6.0,>=0.5.4->asltk>=0.7.1<1.0.0)
  Using cached webcolors-24.11.1-py3-none-any.whl.metadata (2.2 kB)
Requirement already satisfied: matplotlib in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from antspyx<0.6.0,>=0.5.4->asltk>=0.7.1<1.0.0) (3.9.4)
Requirement already satisfied: Pillow in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from antspyx<0.6.0,>=0.5.4->asltk>=0.7.1<1.0.0) (10.3.0)
Requirement already satisfied: requests in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from antspyx<0.6.0,>=0.5.4->asltk>=0.7.1<1.0.0) (2.32.3)
Requirement already satisfied: packaging in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from kagglehub<0.4.0,>=0.3.12->asltk>=0.7.1<1.0.0) (24.0)
Requirement already satisfied: tqdm in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from kagglehub<0.4.0,>=0.3.12->asltk>=0.7.1<1.0.0) (4.67.1)
Requirement already satisfied: nibabel>=3.0 in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from pybids<0.18.0,>=0.17.2->asltk>=0.7.1<1.0.0) (5.3.2)
Collecting formulaic<0.6,>=0.2.4 (from pybids<0.18.0,>=0.17.2->asltk>=0.7.1<1.0.0)
  Downloading formulaic-0.5.2-py3-none-any.whl.metadata (5.7 kB)
Collecting sqlalchemy>=1.3.16 (from pybids<0.18.0,>=0.17.2->asltk>=0.7.1<1.0.0)
  Downloading sqlalchemy-2.0.43-cp39-cp39-win_amd64.whl.metadata (9.8 kB)
Collecting bids-validator>=1.11 (from pybids<0.18.0,>=0.17.2->asltk>=0.7.1<1.0.0)
  Downloading bids_validator-1.14.7.post0-py3-none-any.whl.metadata (39 kB)
Collecting num2words>=0.5.5 (from pybids<0.18.0,>=0.17.2->asltk>=0.7.1<1.0.0)
  Downloading num2words-0.5.14-py3-none-any.whl.metadata (13 kB)
Collecting click>=8.0 (from pybids<0.18.0,>=0.17.2->asltk>=0.7.1<1.0.0)
  Using cached click-8.1.8-py3-none-any.whl.metadata (2.3 kB)
Collecting universal-pathlib>=0.2.2 (from pybids<0.18.0,>=0.17.2->asltk>=0.7.1<1.0.0)
  Downloading universal_pathlib-0.2.6-py3-none-any.whl.metadata (25 kB)
Collecting markdown-it-py>=2.2.0 (from rich<14.0.0,>=13.8.1->asltk>=0.7.1<1.0.0)
  Using cached markdown_it_py-3.0.0-py3-none-any.whl.metadata (6.9 kB)
Collecting pygments<3.0.0,>=2.13.0 (from rich<14.0.0,>=13.8.1->asltk>=0.7.1<1.0.0)
  Using cached pygments-2.19.2-py3-none-any.whl.metadata (2.5 kB)
Requirement already satisfied: typing-extensions<5.0,>=4.0.0 in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from rich<14.0.0,>=13.8.1->asltk>=0.7.1<1.0.0) (4.12.1)
Collecting bidsschematools>=0.10 (from bids-validator>=1.11->pybids<0.18.0,>=0.17.2->asltk>=0.7.1<1.0.0)
  Downloading bidsschematools-1.1.0-py3-none-any.whl.metadata (3.2 kB)
Requirement already satisfied: colorama in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from click>=8.0->pybids<0.18.0,>=0.17.2->asltk>=0.7.1<1.0.0) (0.4.6)
Collecting astor>=0.8 (from formulaic<0.6,>=0.2.4->pybids<0.18.0,>=0.17.2->asltk>=0.7.1<1.0.0)
  Using cached astor-0.8.1-py2.py3-none-any.whl.metadata (4.2 kB)
Collecting interface-meta>=1.2.0 (from formulaic<0.6,>=0.2.4->pybids<0.18.0,>=0.17.2->asltk>=0.7.1<1.0.0)
  Downloading interface_meta-1.3.0-py3-none-any.whl.metadata (6.7 kB)
Requirement already satisfied: wrapt>=1.0 in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from formulaic<0.6,>=0.2.4->pybids<0.18.0,>=0.17.2->asltk>=0.7.1<1.0.0) (1.16.0)
Collecting mdurl~=0.1 (from markdown-it-py>=2.2.0->rich<14.0.0,>=13.8.1->asltk>=0.7.1<1.0.0)
  Using cached mdurl-0.1.2-py3-none-any.whl.metadata (1.6 kB)
Requirement already satisfied: importlib-resources>=5.12 in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from nibabel>=3.0->pybids<0.18.0,>=0.17.2->asltk>=0.7.1<1.0.0) (6.5.2)
Collecting docopt>=0.6.2 (from num2words>=0.5.5->pybids<0.18.0,>=0.17.2->asltk>=0.7.1<1.0.0)
  Using cached docopt-0.6.2-py2.py3-none-any.whl
Requirement already satisfied: python-dateutil>=2.8.2 in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from pandas->antspyx<0.6.0,>=0.5.4->asltk>=0.7.1<1.0.0) (2.9.0.post0)
Requirement already satisfied: pytz>=2020.1 in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from pandas->antspyx<0.6.0,>=0.5.4->asltk>=0.7.1<1.0.0) (2025.2)
Requirement already satisfied: tzdata>=2022.7 in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from pandas->antspyx<0.6.0,>=0.5.4->asltk>=0.7.1<1.0.0) (2025.2)
Collecting greenlet>=1 (from sqlalchemy>=1.3.16->pybids<0.18.0,>=0.17.2->asltk>=0.7.1<1.0.0)
  Downloading greenlet-3.2.4-cp39-cp39-win_amd64.whl.metadata (4.2 kB)
Requirement already satisfied: fsspec!=2024.3.1,>=2022.1.0 in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from universal-pathlib>=0.2.2->pybids<0.18.0,>=0.17.2->asltk>=0.7.1<1.0.0) (2024.6.1)
Requirement already satisfied: contourpy>=1.0.1 in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from matplotlib->antspyx<0.6.0,>=0.5.4->asltk>=0.7.1<1.0.0) (1.3.0)
Requirement already satisfied: cycler>=0.10 in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from matplotlib->antspyx<0.6.0,>=0.5.4->asltk>=0.7.1<1.0.0) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from matplotlib->antspyx<0.6.0,>=0.5.4->asltk>=0.7.1<1.0.0) (4.59.2)
Requirement already satisfied: kiwisolver>=1.3.1 in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from matplotlib->antspyx<0.6.0,>=0.5.4->asltk>=0.7.1<1.0.0) (1.4.7)
Requirement already satisfied: pyparsing>=2.3.1 in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from matplotlib->antspyx<0.6.0,>=0.5.4->asltk>=0.7.1<1.0.0) (3.1.2)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from requests->antspyx<0.6.0,>=0.5.4->asltk>=0.7.1<1.0.0) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from requests->antspyx<0.6.0,>=0.5.4->asltk>=0.7.1<1.0.0) (3.7)
Requirement already satisfied: urllib3<3,>=1.21.1 in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from requests->antspyx<0.6.0,>=0.5.4->asltk>=0.7.1<1.0.0) (2.2.1)
Requirement already satisfied: certifi>=2017.4.17 in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from requests->antspyx<0.6.0,>=0.5.4->asltk>=0.7.1<1.0.0) (2024.2.2)
Collecting patsy>=0.5.6 (from statsmodels->antspyx<0.6.0,>=0.5.4->asltk>=0.7.1<1.0.0)
  Using cached patsy-1.0.1-py2.py3-none-any.whl.metadata (3.3 kB)
Collecting acres (from bidsschematools>=0.10->bids-validator>=1.11->pybids<0.18.0,>=0.17.2->asltk>=0.7.1<1.0.0)
  Downloading acres-0.5.0-py3-none-any.whl.metadata (6.2 kB)
Requirement already satisfied: zipp>=3.1.0 in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from importlib-resources>=5.12->nibabel>=3.0->pybids<0.18.0,>=0.17.2->asltk>=0.7.1<1.0.0) (3.23.0)
Requirement already satisfied: six>=1.5 in c:\tmp\slicer 5.8.1\lib\python\lib\site-packages (from python-dateutil>=2.8.2->pandas->antspyx<0.6.0,>=0.5.4->asltk>=0.7.1<1.0.0) (1.16.0)
Downloading asltk-0.7.1-py3-none-any.whl (84 kB)
   ---------------------------------------- 84.3/84.3 kB 4.6 MB/s eta 0:00:00
Downloading antspyx-0.5.4-cp39-cp39-win_amd64.whl (8.7 MB)
   ---------------------------------------- 8.7/8.7 MB 19.2 MB/s eta 0:00:00
Using cached dill-0.3.9-py3-none-any.whl (119 kB)
Downloading kagglehub-0.3.13-py3-none-any.whl (68 kB)
   ---------------------------------------- 68.3/68.3 kB 3.9 MB/s eta 0:00:00
Downloading pybids-0.17.2-py3-none-any.whl (14.9 MB)
   ---------------------------------------- 14.9/14.9 MB 21.1 MB/s eta 0:00:00
Using cached rich-13.9.4-py3-none-any.whl (242 kB)
Downloading simpleitk-2.5.2-cp39-cp39-win_amd64.whl (18.8 MB)
   ---------------------------------------- 18.8/18.8 MB 15.2 MB/s eta 0:00:00
Downloading bids_validator-1.14.7.post0-py3-none-any.whl (23 kB)
Using cached click-8.1.8-py3-none-any.whl (98 kB)
Downloading formulaic-0.5.2-py3-none-any.whl (77 kB)
   ---------------------------------------- 77.1/77.1 kB 4.5 MB/s eta 0:00:00
Using cached markdown_it_py-3.0.0-py3-none-any.whl (87 kB)
Downloading num2words-0.5.14-py3-none-any.whl (163 kB)
   ---------------------------------------- 163.5/163.5 kB 4.9 MB/s eta 0:00:00
Using cached pygments-2.19.2-py3-none-any.whl (1.2 MB)
Downloading sqlalchemy-2.0.43-cp39-cp39-win_amd64.whl (2.1 MB)
   ---------------------------------------- 2.1/2.1 MB 22.5 MB/s eta 0:00:00
Downloading universal_pathlib-0.2.6-py3-none-any.whl (50 kB)
   ---------------------------------------- 50.1/50.1 kB 2.5 MB/s eta 0:00:00
Downloading statsmodels-0.14.5-cp39-cp39-win_amd64.whl (9.7 MB)
   ---------------------------------------- 9.7/9.7 MB 22.9 MB/s eta 0:00:00
Using cached webcolors-24.11.1-py3-none-any.whl (14 kB)
Using cached astor-0.8.1-py2.py3-none-any.whl (27 kB)
Downloading bidsschematools-1.1.0-py3-none-any.whl (179 kB)
   --------------------------------------- 179.2/179.2 kB 11.3 MB/s eta 0:00:00
Downloading greenlet-3.2.4-cp39-cp39-win_amd64.whl (298 kB)
   --------------------------------------- 298.5/298.5 kB 18.0 MB/s eta 0:00:00
Downloading interface_meta-1.3.0-py3-none-any.whl (14 kB)
Using cached mdurl-0.1.2-py3-none-any.whl (10.0 kB)
Using cached patsy-1.0.1-py2.py3-none-any.whl (232 kB)
Downloading acres-0.5.0-py3-none-any.whl (12 kB)
Installing collected packages: SimpleITK, docopt, webcolors, universal-pathlib, pygments, patsy, num2words, mdurl, interface-meta, greenlet, dill, click, astor, sqlalchemy, markdown-it-py, kagglehub, acres, statsmodels, rich, formulaic, bidsschematools, bids-validator, antspyx, pybids, asltk
  Attempting uninstall: SimpleITK
    Found existing installation: SimpleITK 2.4.0rc2.dev213
    Uninstalling SimpleITK-2.4.0rc2.dev213:
      Successfully uninstalled SimpleITK-2.4.0rc2.dev213
Successfully installed SimpleITK-2.5.2 acres-0.5.0 antspyx-0.5.4 asltk-0.7.1 astor-0.8.1 bids-validator-1.14.7.post0 bidsschematools-1.1.0 click-8.1.8 dill-0.3.9 docopt-0.6.2 formulaic-0.5.2 greenlet-3.2.4 interface-meta-1.3.0 kagglehub-0.3.13 markdown-it-py-3.0.0 mdurl-0.1.2 num2words-0.5.14 patsy-1.0.1 pybids-0.17.2 pygments-2.19.2 rich-13.9.4 sqlalchemy-2.0.43 statsmodels-0.14.5 universal-pathlib-0.2.6 webcolors-24.11.1
[
    'C:/D/Slicer-ASLtoolkit/CBF_ATT_ASL/CBF_ATT_ASL.py',
    '--outputFolder',
    'C:/tmp/20250918-asltest/output',
    '--inputASL',
    'C:/tmp/20250918-asltest/pcasl.nii.gz',
    '--inputM0',
    'C:/tmp/20250918-asltest/m0_mean.nii.gz',
    '--brainMask',
    'C:/tmp/20250918-asltest/m0_bet_mask.nii.gz',
    '170.0, 270.0, 370.0, 520.0, 670.0, 1070.0, 1870.0',
    '100.0, 100.0, 150.0, 150.0, 400.0, 800.0, 1800.0',
    'C:/Users/andra/AppData/Local/Temp/Slicer/ECGBG_vtkMRMLScalarVolumeNodeB.nr
rd',
    'true',
    'C:/Users/andra/AppData/Local/Temp/Slicer/ECGBG_vtkMRMLScalarVolumeNodeC.nr
rd',
    'false'
]
 --- CBF/ATT ASL Input Data ---
ASL file path: C:/tmp/20250918-asltest/pcasl.nii.gz
ASL image dimension: (8, 7, 17, 80, 80)
Mask file path: C:/tmp/20250918-asltest/m0_bet_mask.nii.gz
Mask image dimension: (17, 80, 80)
M0 file path: C:/tmp/20250918-asltest/m0_mean.nii.gz
M0 image dimension: (17, 80, 80)
PLD: [170.0, 270.0, 370.0, 520.0, 670.0, 1070.0, 1870.0]
LD: [100.0, 100.0, 150.0, 150.0, 400.0, 800.0, 1800.0]
---- Advanced Options ----
Output normalized CBF: True
Average M0: True


2025-09-18 09:16:31 - asltk.asldata - INFO - Creating ASLData object
2025-09-18 09:16:31 - asltk.asldata - INFO - Loading ASL image from: C:/tmp/20250918-asltest/pcasl.nii.gz
2025-09-18 09:16:31 - asltk - INFO - Loaded ASL image: shape=(8, 7, 17, 80, 80), path=C:/tmp/20250918-asltest/pcasl.nii.gz
2025-09-18 09:16:31 - asltk.asldata - INFO - Loading M0 image from: C:/tmp/20250918-asltest/m0_mean.nii.gz
2025-09-18 09:16:31 - asltk - INFO - Loaded M0 image: shape=(17, 80, 80), path=C:/tmp/20250918-asltest/m0_mean.nii.gz
2025-09-18 09:16:31 - asltk.asldata - INFO - ASL timing parameters - LD: [100.0, 100.0, 150.0, 150.0, 400.0, 800.0, 1800.0], PLD: [170.0, 270.0, 370.0, 520.0, 670.0, 1070.0, 1870.0]
2025-09-18 09:16:31 - asltk.cbf_mapping - INFO - Setting brain mask with label 1
Traceback (most recent call last):
  File "C:\D\Slicer-ASLtoolkit\CBF_ATT_ASL\CBF_ATT_ASL.py", line 146, in <module>
    executeScript(args)
  File "C:\D\Slicer-ASLtoolkit\CBF_ATT_ASL\CBF_ATT_ASL.py", line 91, in executeScript
    recon.set_brain_mask(mask_img)
  File "C:\tmp\Slicer 5.8.1\lib\Python\Lib\site-packages\asltk\reconstruction\cbf_mapping.py", line 126, in set_brain_mask
    _check_mask_values(brain_mask, label, self._asl_data('m0').shape)
  File "C:\tmp\Slicer 5.8.1\lib\Python\Lib\site-packages\asltk\aux_methods.py", line 34, in _check_mask_values
    raise TypeError(
TypeError: Image mask dimension does not match with input 3D volume. Mask shape (17, 80, 80) not equal to (80, 80)
  1. It could be more convenient to get all the inputs from the scene. Then the user could just drag-and-drop the files to the application window and then in the module select nodes from a dropdown menu. You can keep the file inputs as well, but I would put them in an "Advanced" section, collapsed by default. You could also consider adding te values to the GUI.

  2. If you used NRRD format for image storage, you could keep all additional imaging parameters (pld, ld, te) in the image files.

lassoan avatar Sep 18 '25 13:09 lassoan