pet-surface pipeline Error

20 views
Skip to first unread message

DAVID AQUILUÉ LLORENS

unread,
Apr 3, 2025, 5:15:25 PMApr 3
to Clinica
Dear Clinica team,

I have been trying to extract PET surface data from some participants in the ADNI dataset, which have been converted from the raw data using your own adni-converter.

I first run the t1-freesurfer pipeline as mentioned, using the following command:
clinica run t1-freesurfer $BIDS_DIR $CAPS_DIR -tsv $TSV_FILE -np $NPROCS

Looking at the files, it seems that I got (most, maybe I am missing some) of the outputs mentioned in the t1-freesurfer pipeline section in the documentation.


I then run the following pet-surface pipeline command:
clinica run pet-surface $BIDS_DIR $CAPS_DIR $ACQ_LABEL cerebellumPons $PVC_PSF_TSV -tsv $TSV_FILE -np $NPROCS

Where the environment variables are previously set paths to my data, number of cores, etc. that I assume should not come into play for the error. Currently ACQ_LABEL="18FAV45"

However, I get the following error, which I do not know where it may come from...

Traceback (most recent call last):
  File "/home/david/miniconda3/envs/adni_clinica94/bin/clinica", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/david/miniconda3/envs/adni_clinica94/lib/python3.12/site-packages/clinica/cmdline.py", line 113, in main
    cli()
  File "/home/david/miniconda3/envs/adni_clinica94/lib/python3.12/site-packages/click/core.py", line 1161, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/david/miniconda3/envs/adni_clinica94/lib/python3.12/site-packages/click/core.py", line 1082, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/david/miniconda3/envs/adni_clinica94/lib/python3.12/site-packages/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/david/miniconda3/envs/adni_clinica94/lib/python3.12/site-packages/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/david/miniconda3/envs/adni_clinica94/lib/python3.12/site-packages/click/core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/david/miniconda3/envs/adni_clinica94/lib/python3.12/site-packages/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/david/miniconda3/envs/adni_clinica94/lib/python3.12/site-packages/clinica/pipelines/pet_surface/pet_surface_cli.py", line 77, in cli
    pipeline.run(plugin="MultiProc", plugin_args={"n_procs": n_procs})
  File "/home/david/miniconda3/envs/adni_clinica94/lib/python3.12/site-packages/clinica/pipelines/engine.py", line 729, in run
    self.build()
  File "/home/david/miniconda3/envs/adni_clinica94/lib/python3.12/site-packages/clinica/pipelines/engine.py", line 45, in func_wrapper
    res = func(self, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/david/miniconda3/envs/adni_clinica94/lib/python3.12/site-packages/clinica/pipelines/engine.py", line 693, in build
    self._build_input_node()
  File "/home/david/miniconda3/envs/adni_clinica94/lib/python3.12/site-packages/clinica/pipelines/pet_surface/pet_surface_pipeline.py", line 58, in _build_input_node
    self._build_input_node_cross_sectional()
  File "/home/david/miniconda3/envs/adni_clinica94/lib/python3.12/site-packages/clinica/pipelines/pet_surface/pet_surface_pipeline.py", line 314, in _build_input_node_cross_sectional
    check_relative_volume_location_in_world_coordinate_system(
  File "/home/david/miniconda3/envs/adni_clinica94/lib/python3.12/site-packages/clinica/iotools/utils/data_handling/_centering.py", line 216, in check_relative_volume_location_in_world_coordinate_system
    warnings.warn(warning_message)
TypeError: expected string or bytes-like object, got 'NoneType'



Analyzed ADNI participants and sessions:
sub-ADNI002S0413 ses-M132
sub-ADNI002S0413 Ses-M162
sub-ADNI002S1155 Ses-M126

Information about my environment:

clinica version: 0.9.3 (although the same Error occurs with 0.9.4)
Freesurfer version: 7.4.1
spm version: spm12 (MatLab R2024b)

Additionally, everytime I run the pet-surface pipeline Matlab opens up and the pipeline does not continue until I close the window, if you could help me stop that it would be great :).

I also attach some possibly relevant logs and the files.

Thank you very much in advance,

All the best,

David
files_t1_freesurfer.txt
pypeline_pet.log
pypeline_t1.log
output_pet.txt

Nicolas Gensollen

unread,
Apr 4, 2025, 8:41:24 AMApr 4
to Clinica
Hi David,

Thanks for reporting. The specific error you mentioned has been solved in the developement version of Clinica, but not released yet.
Would you be able to install clinica from the development version to see if it solves this problem ? 

Best,
Nicolas

DAVID AQUILUÉ LLORENS

unread,
Apr 4, 2025, 9:07:38 AMApr 4
to Clinica
Hi Nicolas,

Yes, indeed, that seems to solve the first error. However I now get another error, it seems it looks for the ¨get_suvr_mask" function in the clinica/utils/pet.py script instead of the clinica/pipelines/pet/utils.py file.

2025-04-04 15:00:16,605:INFO:Found installation of spm with version 12.7771, satisfying >=12.
2025-04-04 15:00:16,836:INFO:The pipeline will be run on the following 3 image(s):
        - sub-ADNI002S0413 | ses-M132, Ses-M162
        - sub-ADNI002S1155 | Ses-M126
2025-04-04 15:00:16,837:INFO:List available in /tmp/tmpjssbaotn/pet-surface/participants.tsv
2025-04-04 15:00:16,837:INFO:The pipeline will last approximately a few hours per image.

Traceback (most recent call last):
  File "/home/david/miniconda3/envs/adni_clinica_dev/bin/clinica", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/david/miniconda3/envs/adni_clinica_dev/lib/python3.12/site-packages/clinica/cmdline.py", line 113, in main
    cli()
  File "/home/david/miniconda3/envs/adni_clinica_dev/lib/python3.12/site-packages/click/core.py", line 1161, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/david/miniconda3/envs/adni_clinica_dev/lib/python3.12/site-packages/click/core.py", line 1082, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/david/miniconda3/envs/adni_clinica_dev/lib/python3.12/site-packages/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/david/miniconda3/envs/adni_clinica_dev/lib/python3.12/site-packages/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/david/miniconda3/envs/adni_clinica_dev/lib/python3.12/site-packages/click/core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/david/miniconda3/envs/adni_clinica_dev/lib/python3.12/site-packages/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/david/miniconda3/envs/adni_clinica_dev/lib/python3.12/site-packages/clinica/pipelines/pet_surface/pet_surface_cli.py", line 74, in cli

    pipeline.run(plugin="MultiProc", plugin_args={"n_procs": n_procs})
  File "/home/david/miniconda3/envs/adni_clinica_dev/lib/python3.12/site-packages/clinica/pipelines/engine.py", line 778, in run
    raise e
  File "/home/david/miniconda3/envs/adni_clinica_dev/lib/python3.12/site-packages/clinica/pipelines/engine.py", line 759, in run
    exec_graph = Workflow.run(self, plugin, plugin_args, update_hash)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/david/miniconda3/envs/adni_clinica_dev/lib/python3.12/site-packages/nipype/pipeline/engine/workflows.py", line 625, in run
    runner.run(execgraph, updatehash=updatehash, config=self.config)
  File "/home/david/miniconda3/envs/adni_clinica_dev/lib/python3.12/site-packages/nipype/pipeline/plugins/base.py", line 177, in run
    self._clean_queue(jobid, graph, result=result)
  File "/home/david/miniconda3/envs/adni_clinica_dev/lib/python3.12/site-packages/nipype/pipeline/plugins/base.py", line 255, in _clean_queue
    raise RuntimeError("".join(result["traceback"]))
RuntimeError: Traceback (most recent call last):
  File "/home/david/miniconda3/envs/adni_clinica_dev/lib/python3.12/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/david/miniconda3/envs/adni_clinica_dev/lib/python3.12/site-packages/nipype/pipeline/engine/nodes.py", line 525, in run
    result = self._run_interface(execute=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/david/miniconda3/envs/adni_clinica_dev/lib/python3.12/site-packages/nipype/pipeline/engine/nodes.py", line 643, in _run_interface
    return self._run_command(execute)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/david/miniconda3/envs/adni_clinica_dev/lib/python3.12/site-packages/nipype/pipeline/engine/nodes.py", line 769, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node _full_pipeline_mapnode0.

Traceback:

        Traceback (most recent call last):
          File "/home/david/miniconda3/envs/adni_clinica_dev/lib/python3.12/site-packages/nipype/interfaces/base/core.py", line 401, in run
            runtime = self._run_interface(runtime)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/home/david/miniconda3/envs/adni_clinica_dev/lib/python3.12/site-packages/nipype/interfaces/utility/wrappers.py", line 139, in _run_interface
            out = function_handle(**args)
                  ^^^^^^^^^^^^^^^^^^^^^^^
          File "<string>", line 58, in get_wf
        ImportError: cannot import name 'get_suvr_mask' from 'clinica.utils.pet' (/home/david/miniconda3/envs/adni_clinica_dev/lib/python3.12/site-packages/clinica/utils/pet.py)


Can this be an issue in my installation? I installed the development version using:

Let me know if I should do anything differently.

Thank you for the help!

All the best,

David
El dia divendres, 4 d’abril del 2025 a les 14:41:24 UTC+2, Nicolas Gensollen va escriure:

Alice Joubert

unread,
Apr 7, 2025, 8:16:32 AMApr 7
to clinic...@googlegroups.com
Hello David,

Thanks for reporting this issue. We just fixed this on the dev version so if you pull the code again you should be fine. Don't hesitate if you encounter any other problems !

Best,

Alice

--
You received this message because you are subscribed to the Google Groups "Clinica" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clinica-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/clinica-user/8e9fe1a3-a0ea-4533-9339-5f45eb226c47n%40googlegroups.com.
Message has been deleted

DAVID AQUILUÉ LLORENS

unread,
Apr 8, 2025, 7:16:31 AMApr 8
to Clinica
Thanks Alice! That works!

Since I was looking to fix the issue (although I missed that specific import...) I have added a PR #1499 with a simple import fix from the pet-volume pipeline that had the same get_suvr_mask import from the old version.

Thanks again, and will report if any new error arises.

All the best,

David

El dia dilluns, 7 d’abril del 2025 a les 14:16:32 UTC+2, Alice Joubert va escriure:

Alice Joubert

unread,
Apr 8, 2025, 7:17:38 AMApr 8
to Clinica
Thanks for contributing ! I will take a look at your PR soon ;

Best,

Alice

Reply all
Reply to author
Forward
0 new messages