aramis-lab/clinica

pet-files not found

Closed this issue · 8 comments

Description
Clinica can't seem to find my FFDG18 pet data. Raw and pre/post processed data has separately been downloaded and unzipped to the same folder. adni-to-bids converted the images, and t1-linear pipeline has run successfully.

I suspect I have done something wrong, but can't think of how to start figuring it out. Thankful for any help!

Edit: Unless it has something to do with this, #1157 (comment). In that case I'll just wait!

Pipeline

  • pet-linear

Clinica v0.8.1

❯ clinica run pet-linear -tsv ./adni/data/test_pet.tsv -wd ./tmp ./adni/bids ./adni/caps 18FFDG pons2 | tee test-pet.log
2024-04-29 09:11:06,104:ERROR:Clinica faced error(s) while trying to read pet files in your BIDS directory.
Clinica encountered 2 problem(s) while getting PET data with 18FFDG tracer:
        * (sub-ADNI002S0685 | ses-M048): No file found

        * (sub-ADNI002S0729 | ses-M048): No file found

~/forskningsdata
❯ tree ./adni/bids/sub-ADNI002S0685/ses-M048/
./adni/bids/sub-ADNI002S0685/ses-M048/
├── anat
│   └── sub-ADNI002S0685_ses-M048_T1w.nii.gz
├── pet
│   ├── sub-ADNI002S0685_ses-M048_trc-18FAV45_pet.nii.gz
│   ├── sub-ADNI002S0685_ses-M048_trc-18FFDG_rec-coregavg_pet.nii.gz
│   └── sub-ADNI002S0685_ses-M048_trc-18FFDG_rec-coregiso_pet.nii.gz
└── sub-ADNI002S0685_ses-M048_scans.tsv

~/forskningsdata
❯ tree ./adni/bids/sub-ADNI002S0729/ses-M048/
./adni/bids/sub-ADNI002S0729/ses-M048/
├── anat
│   └── sub-ADNI002S0729_ses-M048_T1w.nii.gz
├── pet
│   ├── sub-ADNI002S0729_ses-M048_trc-18FAV45_pet.nii.gz
│   ├── sub-ADNI002S0729_ses-M048_trc-18FFDG_rec-coregavg_pet.nii.gz
│   └── sub-ADNI002S0729_ses-M048_trc-18FFDG_rec-coregiso_pet.nii.gz
└── sub-ADNI002S0729_ses-M048_scans.tsv

~/forskningsdata
❯ tree ./adni/caps/subjects/sub-ADNI002S0685/ses-M048/
./adni/caps/subjects/sub-ADNI002S0685/ses-M048/
└── t1_linear
    ├── sub-ADNI002S0685_ses-M048_space-MNI152NLin2009cSym_desc-Crop_res-1x1x1_T1w.nii.gz
    ├── sub-ADNI002S0685_ses-M048_space-MNI152NLin2009cSym_res-1x1x1_affine.mat
    └── sub-ADNI002S0685_ses-M048_space-MNI152NLin2009cSym_res-1x1x1_T1w.nii.gz

~/forskningsdata
❯ tree ./adni/caps/subjects/sub-ADNI002S0729/ses-M048/
./adni/caps/subjects/sub-ADNI002S0729/ses-M048/
└── t1_linear
    ├── sub-ADNI002S0729_ses-M048_space-MNI152NLin2009cSym_desc-Crop_res-1x1x1_T1w.nii.gz
    ├── sub-ADNI002S0729_ses-M048_space-MNI152NLin2009cSym_res-1x1x1_affine.mat
    └── sub-ADNI002S0729_ses-M048_space-MNI152NLin2009cSym_res-1x1x1_T1w.nii.gz

Hi @espentrydal !

Again, thanks for reporting these issues !

Did you run the ADNI to BIDS conversion with Clinica 0.8.1 as well ? What command did you use ?

I'm trying to reproduce, but I cannot obtain the same output as yours (I'm using subject "002_S_0685" to debug):

I'm using the following command:

$ clinica convert adni-to-bids raw clinical bids

The bids output is, with clinica 0.8.1:

├── sub-ADNI002S0685
│   ├── ses-M048
│   │   ├── pet
│   │   │   └── sub-ADNI002S0685_ses-M048_trc-18FFDG_rec-coregiso_pet.nii.gz
│   │   └── sub-ADNI002S0685_ses-M048_scans.tsv
│   ├── ses-M060
│   │   ├── anat
│   │   │   ├── sub-ADNI002S0685_ses-M060_FLAIR.json
│   │   │   └── sub-ADNI002S0685_ses-M060_FLAIR.nii.gz
│   │   ├── func
│   │   │   ├── sub-ADNI002S0685_ses-M060_task-rest_bold.json
│   │   │   └── sub-ADNI002S0685_ses-M060_task-rest_bold.nii.gz
│   │   └── sub-ADNI002S0685_ses-M060_scans.tsv
│   ├── ses-M072
│   │   ├── anat
│   │   │   ├── sub-ADNI002S0685_ses-M072_FLAIR.json
│   │   │   └── sub-ADNI002S0685_ses-M072_FLAIR.nii.gz
│   │   ├── func
│   │   │   ├── sub-ADNI002S0685_ses-M072_task-rest_bold.json
│   │   │   └── sub-ADNI002S0685_ses-M072_task-rest_bold.nii.gz
│   │   ├── pet
│   │   │   └── sub-ADNI002S0685_ses-M072_trc-18FFDG_rec-coregiso_pet.nii.gz
│   │   └── sub-ADNI002S0685_ses-M072_scans.tsv
│   └── sub-ADNI002S0685_sessions.tsv

I'm getting some pet scans but not as many as you apparently...

A bit concerning is that, with clinica 0.9.0.dev and the same command, I'm getting the following output:

├── sub-ADNI002S0685
│   ├── ses-M060
│   │   ├── anat
│   │   │   ├── sub-ADNI002S0685_ses-M060_FLAIR.json
│   │   │   └── sub-ADNI002S0685_ses-M060_FLAIR.nii.gz
│   │   ├── func
│   │   │   ├── sub-ADNI002S0685_ses-M060_task-rest_bold.json
│   │   │   └── sub-ADNI002S0685_ses-M060_task-rest_bold.nii.gz
│   │   └── sub-ADNI002S0685_ses-M060_scans.tsv
│   ├── ses-M072
│   │   ├── anat
│   │   │   ├── sub-ADNI002S0685_ses-M072_FLAIR.json
│   │   │   └── sub-ADNI002S0685_ses-M072_FLAIR.nii.gz
│   │   ├── func
│   │   │   ├── sub-ADNI002S0685_ses-M072_task-rest_bold.json
│   │   │   └── sub-ADNI002S0685_ses-M072_task-rest_bold.nii.gz
│   │   └── sub-ADNI002S0685_ses-M072_scans.tsv
│   └── sub-ADNI002S0685_sessions.tsv

where all PET scans disappeared...

I suspect that this regression has something to do with #1157. @HuguesRoy are you having similar results with your recent fix ?

Hi @NicolasGensollen , thanks for looking into this!

Yes, I did the conversion with Clinica v0.8.1. I first only downloaded the raw images, and after rereading the documentation I also downloaded the pre-processed images to be sure not to miss anything. I unzipped all into the same "raw" directory before running the converter (clinica convert adni-to-bids adni/RAW adni/clinical ./adni/bids).

The 18FAV45 I assume is ignored when I choose 18FFDG. The converter seems to have converted both the coregistred averaged as well as the one with uniform resolution (3 and 4 here I think: https://adni.loni.usc.edu/methods/pet-analysis-method/pet-analysis/).

On Loni I can see both exist for this patient:
image

But if the pet-linear pipeline only needs the rec-coregiso that we both have, then I guess it should still find the correct file?

Hi @espentrydal

Thanks for your detailed response. I believe I made some mistakes while downloading the data (probably downloaded only the raw images the first time... 🙄 ).
I started again and both adni-to-bids and t1-linear ran without any issues.

I managed to run the pet-linear pipeline as well by:

  • specifying a participants TSV file giving the subjects/sessions which have the required data:
$ cat participants.tsv
participant_id  session_id
sub-ADNI002S0685        ses-M048
sub-ADNI002S0729        ses-M048

Otherwise, the file reader will raise an error saying that some subject/session are missing files.

  • And specifying the reconstruction method to be selected (since you have both coreg_avg and coreg_iso, the file reader will raise an error saying that it found too many files otherwise):
$ clinica run pet-linear -tsv participants.tsv -wd tmp bids caps 18FFDG pons2 -rec coregiso

This gives me (for sub-ADNI002S0685):

caps
`-- subjects
    |-- sub-ADNI002S0685
    |   |-- ses-M000
    |   |   `-- t1_linear
    |   |       |-- sub-ADNI002S0685_ses-M000_space-MNI152NLin2009cSym_desc-Crop_res-1x1x1_T1w.nii.gz
    |   |       |-- sub-ADNI002S0685_ses-M000_space-MNI152NLin2009cSym_res-1x1x1_T1w.nii.gz
    |   |       `-- sub-ADNI002S0685_ses-M000_space-MNI152NLin2009cSym_res-1x1x1_affine.mat
    |   |-- ses-M006
    |   |   `-- t1_linear
    |   |       |-- sub-ADNI002S0685_ses-M006_space-MNI152NLin2009cSym_desc-Crop_res-1x1x1_T1w.nii.gz
    |   |       |-- sub-ADNI002S0685_ses-M006_space-MNI152NLin2009cSym_res-1x1x1_T1w.nii.gz
    |   |       `-- sub-ADNI002S0685_ses-M006_space-MNI152NLin2009cSym_res-1x1x1_affine.mat
    |   |-- ses-M012
    |   |   `-- t1_linear
    |   |       |-- sub-ADNI002S0685_ses-M012_space-MNI152NLin2009cSym_desc-Crop_res-1x1x1_T1w.nii.gz
    |   |       |-- sub-ADNI002S0685_ses-M012_space-MNI152NLin2009cSym_res-1x1x1_T1w.nii.gz
    |   |       `-- sub-ADNI002S0685_ses-M012_space-MNI152NLin2009cSym_res-1x1x1_affine.mat
    |   |-- ses-M024
    |   |   `-- t1_linear
    |   |       |-- sub-ADNI002S0685_ses-M024_space-MNI152NLin2009cSym_desc-Crop_res-1x1x1_T1w.nii.gz
    |   |       |-- sub-ADNI002S0685_ses-M024_space-MNI152NLin2009cSym_res-1x1x1_T1w.nii.gz
    |   |       `-- sub-ADNI002S0685_ses-M024_space-MNI152NLin2009cSym_res-1x1x1_affine.mat
    |   |-- ses-M036
    |   |   `-- t1_linear
    |   |       |-- sub-ADNI002S0685_ses-M036_space-MNI152NLin2009cSym_desc-Crop_res-1x1x1_T1w.nii.gz
    |   |       |-- sub-ADNI002S0685_ses-M036_space-MNI152NLin2009cSym_res-1x1x1_T1w.nii.gz
    |   |       `-- sub-ADNI002S0685_ses-M036_space-MNI152NLin2009cSym_res-1x1x1_affine.mat
    |   |-- ses-M048
    |   |   |-- pet_linear
    |   |   |   |-- sub-ADNI002S0685_ses-M048_trc-18FFDG_rec-coregiso_space-MNI152NLin2009cSym_desc-Crop_res-1x1x1_suvr-pons2_pet.nii.gz
    |   |   |   `-- sub-ADNI002S0685_ses-M048_trc-18FFDG_rec-coregiso_space-T1w_rigid.mat
    |   |   `-- t1_linear
    |   |       |-- sub-ADNI002S0685_ses-M048_space-MNI152NLin2009cSym_desc-Crop_res-1x1x1_T1w.nii.gz
    |   |       |-- sub-ADNI002S0685_ses-M048_space-MNI152NLin2009cSym_res-1x1x1_T1w.nii.gz
    |   |       `-- sub-ADNI002S0685_ses-M048_space-MNI152NLin2009cSym_res-1x1x1_affine.mat
    |   |-- ses-M060
    |   |   `-- t1_linear
    |   |       |-- sub-ADNI002S0685_ses-M060_space-MNI152NLin2009cSym_desc-Crop_res-1x1x1_T1w.nii.gz
    |   |       |-- sub-ADNI002S0685_ses-M060_space-MNI152NLin2009cSym_res-1x1x1_T1w.nii.gz
    |   |       `-- sub-ADNI002S0685_ses-M060_space-MNI152NLin2009cSym_res-1x1x1_affine.mat
    |   `-- ses-M072
    |       `-- t1_linear
    |           |-- sub-ADNI002S0685_ses-M072_space-MNI152NLin2009cSym_desc-Crop_res-1x1x1_T1w.nii.gz
    |           |-- sub-ADNI002S0685_ses-M072_space-MNI152NLin2009cSym_res-1x1x1_T1w.nii.gz
    |           `-- sub-ADNI002S0685_ses-M072_space-MNI152NLin2009cSym_res-1x1x1_affine.mat

Let me know if you can run the pipeline with these two adjustments.

Hi @NicolasGensollen

Thank you for getting back to me so fast. That seems indeed to have been my issue and I managed to run the pipeline for a while. It did abort with another error message though, which I think must be something unrelated to my earlier issues:

Traceback (most recent call last):
  File "/home/espen/forskningsdata/clinica/.venv/bin/clinica", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/clinica/cmdline.py", line 92, in main
    cli()
  File "/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/clinica/pipelines/pet_linear/pet_linear_cli.py", line 87, in cli
    pipeline.run(plugin="MultiProc", plugin_args={"n_procs": n_procs})
  File "/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/clinica/pipelines/engine.py", line 715, in run
    raise e
  File "/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/clinica/pipelines/engine.py", line 696, in run
    exec_graph = Workflow.run(self, plugin, plugin_args, update_hash)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/nipype/pipeline/engine/workflows.py", line 638, in run
    runner.run(execgraph, updatehash=updatehash, config=self.config)
  File "/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/nipype/pipeline/plugins/base.py", line 178, in run
    self._clean_queue(jobid, graph, result=result)
  File "/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/nipype/pipeline/plugins/base.py", line 256, in _clean_queue
    raise RuntimeError("".join(result["traceback"]))
RuntimeError: Traceback (most recent call last):
  File "/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node antsApplyTransformPET2MNI.

Cmdline:
        antsApplyTransforms --default-value 0 --dimensionality 3 --float 0 --input /home/espen/forskningsdata/adni/bids/sub-ADNI002S0685/ses-M048/pet/sub-ADNI002S0685_ses-M048_trc-18FFDG_rec-coregiso_pet.nii.gz --interpolation Linear --output sub-ADNI002S0685_ses-M048_trc-18FFDG_rec-coregiso_pet_trans.nii.gz --reference-image /home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/clinica/resources/masks/mni_icbm152_t1_tal_nlin_sym_09c.nii --transform /home/espen/forskningsdata/adni/caps/subjects/sub-ADNI002S0685/ses-M048/t1_linear/sub-ADNI002S0685_ses-M048_space-MNI152NLin2009cSym_res-1x1x1_affine.mat --transform /home/espen/forskningsdata/tmp/pet-linear/535f6ade16e452dde02beaa53cbd1302a49a920c/antsRegistration/transform0GenericAffine.mat
Stdout:

Stderr:

Traceback:
        Traceback (most recent call last):
          File "/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/nipype/interfaces/base/core.py", line 453, in aggregate_outputs
            setattr(outputs, key, val)
          File "/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/nipype/interfaces/base/traits_extension.py", line 330, in validate
            value = super(File, self).validate(objekt, name, value, return_pathlike=True)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/nipype/interfaces/base/traits_extension.py", line 135, in validate
            self.error(objekt, name, str(value))
          File "/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/traits/base_trait_handler.py", line 74, in error
            raise TraitError(
        traits.trait_errors.TraitError: The 'output_image' trait of an ApplyTransformsOutputSpec instance must be a pathlike object or string representing an existing file, but a value of '/home/espen/forskningsdata/tmp/pet-linear/535f6ade16e452dde02beaa53cbd1302a49a920c/antsApplyTransformPET2MNI/sub-ADNI002S0685_ses-M048_trc-18FFDG_rec-coregiso_pet_trans.nii.gz' <class 'str'> was specified.

        During handling of the above exception, another exception occurred:

        Traceback (most recent call last):
          File "/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/nipype/interfaces/base/core.py", line 400, in run
            outputs = self.aggregate_outputs(runtime)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/nipype/interfaces/base/core.py", line 460, in aggregate_outputs
            raise FileNotFoundError(msg)
        FileNotFoundError: No such file or directory '/home/espen/forskningsdata/tmp/pet-linear/535f6ade16e452dde02beaa53cbd1302a49a920c/antsApplyTransformPET2MNI/sub-ADNI002S0685_ses-M048_trc-18FFDG_rec-coregiso_pet_trans.nii.gz' for output 'output_image' of a ApplyTransforms interface

sub-ADNI002S0685 would be the first subject in my tsv-file.

2024-04-29 22:46:49,875:INFO:The pipeline will be run on the following 528 image(s):
2024-04-29 22:46:49,875:INFO:   sub-ADNI002S0685 | ses-M048,
2024-04-29 22:46:49,875:INFO:   sub-ADNI002S0729 | ses-M048,
2024-04-29 22:46:49,875:INFO:   sub-ADNI002S1155 | ses-M048, ses-M126,
2024-04-29 22:46:49,875:INFO:   sub-ADNI002S1261 | ses-M048,
2024-04-29 22:46:49,875:INFO:   sub-ADNI002S1268 | ses-M048,
2024-04-29 22:46:49,875:INFO:   sub-ADNI002S1280 | ses-M048,
2024-04-29 22:46:49,875:INFO:   sub-ADNI002S2010 | ses-M000,
2024-04-29 22:46:49,875:INFO:   sub-ADNI002S2043 | ses-M000,
2024-04-29 22:46:49,875:INFO:   sub-ADNI002S2073 | ses-M000,
2024-04-29 22:46:49,875:INFO:   sub-ADNI002S4225 | ses-M084,
2024-04-29 22:46:49,875:INFO:   sub-ADNI002S4229 | ses-M072,
2024-04-29 22:46:49,875:INFO:   sub-ADNI002S4654 | ses-M060,
2024-04-29 22:46:49,875:INFO:   sub-ADNI002S4799 | ses-M060,
2024-04-29 22:46:49,875:INFO:   sub-ADNI002S6652 | ses-M000,
2024-04-29 22:46:49,875:INFO:   sub-ADNI002S6695 | ses-M000,
2024-04-29 22:46:49,875:INFO:   sub-ADNI003S0907 | ses-M048,
2024-04-29 22:46:49,875:INFO:   sub-ADNI003S0908 | ses-M048, ses-M132,
2024-04-29 22:46:49,875:INFO:   sub-ADNI003S0981 | ses-M048,
2024-04-29 22:46:49,875:INFO:   sub-ADNI003S1057 | ses-M048,
2024-04-29 22:46:49,875:INFO:   sub-ADNI003S1074 | ses-M048, ses-M126,
2024-04-29 22:46:49,875:INFO:   sub-ADNI003S1122 | ses-M048, ses-M126,
2024-04-29 22:46:49,875:INFO:   sub-ADNI003S2374 | ses-M000,
2024-04-29 22:46:49,875:INFO:   sub-ADNI003S4354 | ses-M066,
2024-04-29 22:46:49,875:INFO:   sub-ADNI003S6258 | ses-M000,
2024-04-29 22:46:49,875:INFO:   sub-ADNI003S6264 | ses-M000,
2024-04-29 22:46:49,875:INFO:   ...
2024-04-29 22:46:49,875:INFO:   sub-ADNI941S7041 | ses-M000,
2024-04-29 22:46:49,875:INFO:The pipeline will last approximately 3 minutes per image.
2024-04-29 22:46:53,984:INFO:Running pipeline for sub-ADNI002S0685 | ses-M048
2024-04-29 22:46:53,987:INFO:Running pipeline for sub-ADNI002S0729 | ses-M048
❯ tree adni/bids/sub-ADNI002S0685
adni/bids/sub-ADNI002S0685
├── ses-M048
│   ├── anat
│   │   └── sub-ADNI002S0685_ses-M048_T1w.nii.gz
│   ├── pet
│   │   ├── sub-ADNI002S0685_ses-M048_trc-18FAV45_pet.nii.gz
│   │   ├── sub-ADNI002S0685_ses-M048_trc-18FFDG_rec-coregavg_pet.nii.gz
│   │   └── sub-ADNI002S0685_ses-M048_trc-18FFDG_rec-coregiso_pet.nii.gz
│   └── sub-ADNI002S0685_ses-M048_scans.tsv
└── sub-ADNI002S0685_sessions.tsv

❯ nipypecli show crash-20240429-232400-espen-antsApplyTransformPET2MNI.a000-97349515-fd76-49c8-ab75-dde6d57754d5.pklz
{'node': pet-linear.antsApplyTransformPET2MNI.a000,
 'traceback': ['Traceback (most recent call last):\n',
               '  File '
               '"/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/nipype/pipeline/plugins/multiproc.py", '
               'line 67, in run_node\n'
               '    result["result"] = node.run(updatehash=updatehash)\n'
               '                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n',
               '  File '
               '"/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/nipype/pipeline/engine/nodes.py", '
               'line 527, in run\n'
               '    result = self._run_interface(execute=True)\n'
               '             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n',
               '  File '
               '"/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/nipype/pipeline/engine/nodes.py", '
               'line 645, in _run_interface\n'
               '    return self._run_command(execute)\n'
               '           ^^^^^^^^^^^^^^^^^^^^^^^^^^\n',
               '  File '
               '"/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/nipype/pipeline/engine/nodes.py", '
               'line 771, in _run_command\n'
               '    raise NodeExecutionError(msg)\n',
               'nipype.pipeline.engine.nodes.NodeExecutionError: Exception '
               'raised while executing Node antsApplyTransformPET2MNI.\n'
               '\n'
               'Cmdline:\n'
               '\tantsApplyTransforms --default-value 0 --dimensionality 3 '
               '--float 0 --input '
               '/home/espen/forskningsdata/adni/bids/sub-ADNI002S0685/ses-M048/pet/sub-ADNI002S0685_ses-M048_trc-18FFDG_rec-coregiso_pet.nii.gz '
               '--interpolation Linear --output '
               'sub-ADNI002S0685_ses-M048_trc-18FFDG_rec-coregiso_pet_trans.nii.gz '
               '--reference-image '
               '/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/clinica/resources/masks/mni_icbm152_t1_tal_nlin_sym_09c.nii '
               '--transform '
               '/home/espen/forskningsdata/adni/caps/subjects/sub-ADNI002S0685/ses-M048/t1_linear/sub-ADNI002S0685_ses-M048_space-MNI152NLin2009cSym_res-1x1x1_affine.mat '
               '--transform '
               '/home/espen/forskningsdata/tmp/pet-linear/535f6ade16e452dde02beaa53cbd1302a49a920c/antsRegistration/transform0GenericAffine.mat\n'
               'Stdout:\n'
               '\n'
               'Stderr:\n'
               '\n'
               'Traceback:\n'
               '\tTraceback (most recent call last):\n'
               '\t  File '
               '"/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/nipype/interfaces/base/core.py", '
               'line 453, in aggregate_outputs\n'
               '\t    setattr(outputs, key, val)\n'
               '\t  File '
               '"/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/nipype/interfaces/base/traits_extension.py", '
               'line 330, in validate\n'
               '\t    value = super(File, self).validate(objekt, name, value, '
               'return_pathlike=True)\n'
               '\t            '
               '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n'
               '\t  File '
               '"/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/nipype/interfaces/base/traits_extension.py", '
               'line 135, in validate\n'
               '\t    self.error(objekt, name, str(value))\n'
               '\t  File '
               '"/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/traits/base_trait_handler.py", '
               'line 74, in error\n'
               '\t    raise TraitError(\n'
               "\ttraits.trait_errors.TraitError: The 'output_image' trait of "
               'an ApplyTransformsOutputSpec instance must be a pathlike '
               'object or string representing an existing file, but a value of '
               "'/home/espen/forskningsdata/tmp/pet-linear/535f6ade16e452dde02beaa53cbd1302a49a920c/antsApplyTransformPET2MNI/sub-ADNI002S0685_ses-M048_trc-18FFDG_rec-coregiso_pet_trans.nii.gz' "
               "<class 'str'> was specified.\n"
               '\n'
               '\tDuring handling of the above exception, another exception '
               'occurred:\n'
               '\n'
               '\tTraceback (most recent call last):\n'
               '\t  File '
               '"/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/nipype/interfaces/base/core.py", '
               'line 400, in run\n'
               '\t    outputs = self.aggregate_outputs(runtime)\n'
               '\t              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n'
               '\t  File '
               '"/home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/nipype/interfaces/base/core.py", '
               'line 460, in aggregate_outputs\n'
               '\t    raise FileNotFoundError(msg)\n'
               '\tFileNotFoundError: No such file or directory '
               "'/home/espen/forskningsdata/tmp/pet-linear/535f6ade16e452dde02beaa53cbd1302a49a920c/antsApplyTransformPET2MNI/sub-ADNI002S0685_ses-M048_trc-18FFDG_rec-coregiso_pet_trans.nii.gz' "
               "for output 'output_image' of a ApplyTransforms interface\n"
               '\n']}

❯ tree tmp/pet-linear/535f6ade16e452dde02beaa53cbd1302a49a920c
tmp/pet-linear/535f6ade16e452dde02beaa53cbd1302a49a920c
├── antsApplyTransformPET2MNI
│   ├── command.txt
│   ├── _inputs.pklz
│   ├── _node.pklz
│   ├── _report
│   │   └── report.rst
│   └── result_antsApplyTransformPET2MNI.pklz
├── antsRegistration
│   ├── _0x4308fd02a8ab00356df2ba265d51c0a1.json
│   ├── command.txt
│   ├── _inputs.pklz
│   ├── _node.pklz
│   ├── _report
│   │   └── report.rst
│   ├── result_antsRegistration.pklz
│   ├── transform0GenericAffine.mat
│   ├── transformInverseWarped.nii.gz
│   └── transformWarped.nii.gz
├── antsRegistrationT1W2MNI
│   ├── _0xf1c32f70a8e0016147513ce848c6bfaa.json
│   ├── command.txt
│   ├── _inputs.pklz
│   ├── _node.pklz
│   ├── _report
│   │   └── report.rst
│   ├── result_antsRegistrationT1W2MNI.pklz
│   ├── transform0InverseWarp.nii.gz
│   └── transform0Warp.nii.gz
├── concatenateTransforms
│   ├── _0xba8beac4b82acec2f8e22b4f830322d7.json
│   ├── _inputs.pklz
│   ├── _node.pklz
│   ├── _report
│   │   └── report.rst
│   └── result_concatenateTransforms.pklz
├── containerPath
│   ├── _0xc9e58c82f5e3827754c6bab2992d5f36.json
│   ├── _inputs.pklz
│   ├── _node.pklz
│   ├── _report
│   │   └── report.rst
│   └── result_containerPath.pklz
└── initPipeline
    ├── _0xa39aed61255ee0bee04f70e2e4f8b8cb.json
    ├── _inputs.pklz
    ├── _node.pklz
    ├── _report
    │   └── report.rst
    └── result_initPipeline.pklz

Any idea what could cause this?

@espentrydal Looking at our documentation for pet-linear, it is definitely not clear that the reconstruction method has to be specified and how it should be specified.
So I think, we should definitely improve that as a resulting action point of this issue.

For the error that you're now getting, it seems unrelated indeed.

At first glance, it seems like an error with antsApplyTransforms. What version of ANTs are you using ?

Have you tried running the command from the logs in your terminal ?

antsApplyTransforms --default-value 0 --dimensionality 3 --float 0 \
--input /home/espen/forskningsdata/adni/bids/sub-ADNI002S0685/ses-M048/pet/sub-ADNI002S0685_ses-M048_trc-18FFDG_rec-coregiso_pet.nii.gz \
--interpolation Linear \
--output sub-ADNI002S0685_ses-M048_trc-18FFDG_rec-coregiso_pet_trans.nii.gz \
--reference-image /home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/clinica/resources/masks/mni_icbm152_t1_tal_nlin_sym_09c.nii \
--transform /home/espen/forskningsdata/adni/caps/subjects/sub-ADNI002S0685/ses-M048/t1_linear/sub-ADNI002S0685_ses-M048_space-MNI152NLin2009cSym_res-1x1x1_affine.mat \
--transform /home/espen/forskningsdata/tmp/pet-linear/535f6ade16e452dde02beaa53cbd1302a49a920c/antsRegistration/transform0GenericAffine.mat

You could also verify that the files provided to antsApplyTransforms exist.

@NicolasGensollen I reinstalled v2.5.1 now to be sure (the most recent) (I might inadvertedly have used the development version before that). All the files provided exists. I get this error when I run the command:

❯ antsApplyTransforms --default-value 0 --dimensionality 3 --float 0 \ --input /home/espen/forskningsdata/adni/bids/sub-ADNI002S0685/ses-M048/pet/sub-ADNI002S0685_ses-M048_trc-18FFDG_rec-coregiso_pet.nii.gz \ --interpolation Linear \ --output sub-ADNI002S0685_ses-M048_trc-18FFDG_rec-coregiso_pet_trans.nii.gz \ --reference-image /home/espen/forskningsdata/clinica/.venv/lib64/python3.11/site-packages/clinica/resources/masks/mni_icbm152_t1_tal_nlin_sym_09c.nii \ --transform /home/espen/forskningsdata/adni/caps/subjects/sub-ADNI002S0685/ses-M048/t1_linear/sub-ADNI002S0685_ses-M048_space-MNI152NLin2009cSym_res-1x1x1_affine.mat \ --transform /home/espen/forskningsdata/tmp/pet-linear/535f6ade16e452dde02beaa53cbd1302a49a920c/antsRegistration/transform0GenericAffine.mat
terminate called after throwing an instance of 'itk::ExceptionObject'
  what():  /home/espen/src/ANTs/Utilities/antsCommandLineParser.h:133:
ITK ERROR: CommandLineParser(0x24fccc0): ERROR: Parse error occured during command line argument processing
ERROR: Unable to convert '/home/espen/forskningsdata/tmp/pet-linear/535f6ade16e452dde02beaa53cbd1302a49a920c/antsRegistration/transform0GenericAffine.mat' to type 'b' as Unmapped Type

[1]    313689 IOT instruction (core dumped)  antsApplyTransforms --default-value 0 --dimensionality 3 --float 0 \ --input

@espentrydal any chance this could be due to the "\" I added to break in multiple lines ? Maybe try removing them (or copy paste the command your logs just above).

@NicolasGensollen yes the command now ran without error :) The pet-pipeline now also runs correctly. There must have been a problem with my previous ANTs installation.

Thank you for helping me troubleshoot!