Skip to content
Draft
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
59c18ed
ENH: add PET dataset to repo for testing
mnoergaard Apr 30, 2025
dba9c06
ENH: add petprep_hmc derivatives data
mnoergaard Apr 30, 2025
0471ba7
enh: modify BIDsLayoutIndexer so that it does not ignore the pet file
celprov May 1, 2025
d469b74
enh: copy the fMRI workflow and remove steps that are unnecessary in …
celprov May 1, 2025
64f342d
enh: create a MRIQC workflow for PET imaging. The workflow outputs FD…
celprov May 2, 2025
046864b
sty: ruff formatting
celprov May 2, 2025
3534536
fix: add PET as a supported modality
celprov May 2, 2025
70e8b5a
fix: fix bugs in the workflow
celprov May 2, 2025
b7c05e2
FIX: add traits to dictionary
mnoergaard May 2, 2025
d1067fc
FIX: webapi.py needs to be updated to accommodate upload of PET data
mnoergaard May 2, 2025
1b92a16
FIX: update FD interface
mnoergaard May 5, 2025
6049edb
Update bootstrap-pet.yml
mnoergaard May 9, 2025
359faba
FIX: maximum of 10 mm in FD, as early frames are sometimes quite high
mnoergaard May 9, 2025
e9341a7
FIX: change to max 6 FD
mnoergaard May 9, 2025
b8fd0b4
FIX: remove y-axis cutoff for FD
mnoergaard May 9, 2025
4d5a60d
ENH: add FWHM estimation to IQMs
mnoergaard May 13, 2025
f1bdd61
ENH: make FWHM estimation work on mean PET image
mnoergaard May 13, 2025
bf8865c
ENH: add FWHM estimation per frame
mnoergaard May 13, 2025
8370cd2
ENH: add hammers atlas and template data for PET normalization
mnoergaard May 16, 2025
66d94ee
ENH: add normalization workflow and extraction of time activity curves
mnoergaard May 16, 2025
adf2b31
ENH: add template brain mask
mnoergaard May 17, 2025
4b85a95
ENH: add PET to MNI registration json file for ANTs
mnoergaard May 17, 2025
e18135c
FIX: update normalization workflow to use ANTs instead of mri_coreg
mnoergaard May 17, 2025
0e93b6a
ENH: add TACs and normalization
mnoergaard May 20, 2025
98b29d2
FIX: refactor, add generate_tac_figures to qc/pet.py
mnoergaard May 20, 2025
c164f8b
ENH: update main workflow to output tac and normalization figures to …
mnoergaard May 20, 2025
eeeef22
ENH: add TACs and normalization plotting
mnoergaard May 20, 2025
259cda8
FIX: replate motion plot x-axis with time instead of frames
mnoergaard May 20, 2025
b40fa3d
FIX: forward metadata to motion plots
mnoergaard May 20, 2025
1cff6f9
FIX: update plotting and style
mnoergaard May 21, 2025
b5e5c46
ENH: add carpet plot
mnoergaard May 21, 2025
af4969b
ENH: add carpet plot to pet yml reports
mnoergaard May 21, 2025
5b6bf97
ENH: add units for PETQC
mnoergaard May 26, 2025
21595f5
ENH: Update PET workflow to capture ref_frame
mnoergaard May 26, 2025
8008dfb
ENH: add estimation of mean FWHM across frames
mnoergaard May 26, 2025
bdd80f4
ENH: add tacs tsv file to derivatives
mnoergaard May 26, 2025
eed1cc3
FIX: Update settings in pet_mni_align workflow
mnoergaard May 26, 2025
90d5aec
FIX: update tacs output node
mnoergaard May 26, 2025
37b8b99
ENH: add working nipreps.json file to data
mnoergaard May 26, 2025
3e8a145
FIX: clean up and add documentation
mnoergaard May 26, 2025
315512a
ENH: Add module-level docstring to __init__.py
mnoergaard May 26, 2025
bb38fbd
FIX: Update __all__ in mriqc/interfaces/__init__.py
mnoergaard May 26, 2025
c3cea23
FIX: style cleaning
mnoergaard May 26, 2025
fae581b
ENH: add assertions for ref_frame in test_pet.py
mnoergaard May 26, 2025
6de79aa
ENH: update README.rst with PETQC support
mnoergaard May 26, 2025
42c83b6
FIX: re-add os import to create_pet_carpet_plot
mnoergaard May 26, 2025
cccfe52
FIX: re-add nilearn plot_carpet function
mnoergaard May 26, 2025
cac40b5
FIX: re-add generate_tac_figures import
mnoergaard May 26, 2025
2cdecb6
FIX: update nipreps.json file
mnoergaard May 26, 2025
b6a70d5
ENH: add threshold to PET reference image to improve PET to template …
mnoergaard Jun 4, 2025
099a533
FIX: remove dismiss entities fra carpet and normalization
mnoergaard Jun 4, 2025
0d6ff62
FIX: add dismiss entities again
mnoergaard Jun 4, 2025
d79a831
ENH: allow trc entity for PET data + test
mnoergaard Jun 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions mriqc/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
os.environ['PYTHONWARNINGS'] = 'ignore'


SUPPORTED_SUFFIXES: tuple[str, ...] = ('T1w', 'T2w', 'bold', 'dwi')
SUPPORTED_SUFFIXES: tuple[str, ...] = ('T1w', 'T2w', 'bold', 'dwi', 'pet')

DEFAULT_MEMORY_MIN_GB: float = 0.01
DSA_MESSAGE: str = """\
Expand Down Expand Up @@ -510,10 +510,10 @@ def init(cls) -> None:
# Ignore all modality subfolders, except for func/ or anat/
re.compile(
r'^/sub-[a-zA-Z0-9]+(/ses-[a-zA-Z0-9]+)?/'
r'(beh|fmap|pet|perf|meg|eeg|ieeg|micr|nirs)'
r'(beh|fmap|perf|meg|eeg|ieeg|micr|nirs)'
),
# Ignore all files, except for the supported modalities
re.compile(r'^.+(?<!(_T1w|_T2w|bold|_dwi))\.(json|nii|nii\.gz)$'),
re.compile(r'^.+(?<!(_T1w|_T2w|bold|_pet|_dwi))\.(json|nii|nii\.gz)$'),
]

if cls.participant_label:
Expand Down
39 changes: 39 additions & 0 deletions mriqc/data/bootstrap-pet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package: mriqc
title: "{filename} :: MRIQC's PET report"
sections:
- name: Summary
reportlets:
- bids:
datatype: figures
desc: summary
suffix: pet
extension: [.html]

- name: Motion Correction Reports
reportlets:
- bids:
datatype: figures
desc: fd
extension: [.png]
caption: Framewise Displacement.
subtitle: FD
style:
max-width: 600px

- bids:
datatype: figures
desc: rotation
extension: [.png]
caption: Rotation components of motion correction.
subtitle: Rotation Metrics
style:
max-width: 600px

- bids:
datatype: figures
desc: translation
extension: [.png]
caption: Translation components of motion correction.
subtitle: Translation Metrics
style:
max-width: 600px
11 changes: 11 additions & 0 deletions mriqc/data/pet/dataset_description.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"Name": "PETPrep HMC workflow",
"DatasetType": "derivative",
"BIDSVersion": "1.7.0",
"GeneratedBy": [
{
"Name": "petprep_hmc",
"Version": "0.0.10"
}
]
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
[environment]
cache_path = "PosixPath('/Users/martinnorgaard/.cache/mriqc')"
cpu_count = 10
exec_env = "posix"
freesurfer_home = "/Applications/freesurfer/7.4.1"
overcommit_policy = "n/a"
overcommit_limit = "n/a"
nipype_version = "1.10.0"
synthstrip_path = "PosixPath('/Applications/freesurfer/7.4.1/models/synthstrip.1.pt')"
templateflow_version = "24.2.2"
total_memory = 32.0
version = "25.1.0.dev49+g1b92a165.d20250509"

[execution]
ants_float = false
bids_dir = "/Users/martinnorgaard/Documents/GitHub/mriqc/mriqc/data/pet"
bids_dir_datalad = false
bids_database_dir = "/Users/martinnorgaard/Documents/GitHub/mriqc/mriqc/data/pet/derivatives/mriqc/.bids_db"
bids_database_wipe = false
cwd = "/Users/martinnorgaard/Dropbox/Mac/Documents/GitHub/mriqc"
datalad_get = true
debug = false
dry_run = false
dsname = "<unset>"
float32 = true
layout = "BIDS Layout: /Users/martinnorgaard/Documents/GitHub/mriqc/mriqc/data/pet"
log_dir = "/Users/martinnorgaard/Documents/GitHub/mriqc/mriqc/data/pet/derivatives/mriqc/logs"
log_level = 25
modalities = [ "T1w", "T2w", "bold", "dwi", "pet",]
no_sub = true
notrack = false
output_dir = "/Users/martinnorgaard/Documents/GitHub/mriqc/mriqc/data/pet/derivatives/mriqc"
participant_label = [ "01",]
pdb = false
reports_only = false
resource_monitor = false
run_uuid = "20250509-150839_62d91c5f-fc2a-4ed5-87b2-8c474d5e033e"
templateflow_home = "/Users/martinnorgaard/.cache/templateflow"
upload_strict = false
verbose_reports = false
webapi_url = "https://mriqc.nimh.nih.gov:443/api/v1"
work_dir = "/Users/martinnorgaard/Dropbox/Mac/Documents/GitHub/mriqc/work"
write_graph = false

[workflow]
analysis_level = [ "participant",]
deoblique = false
despike = false
fd_thres = 0.2
fd_radius = 50
fft_spikes_detector = false
inputs_path = "PosixPath('/Users/martinnorgaard/Dropbox/Mac/Documents/GitHub/mriqc/work/inputs-20250509-150839_62d91c5f-fc2a-4ed5-87b2-8c474d5e033e.pkl')"
min_len_dwi = 7
min_len_bold = 5
species = "human"
template_id = "MNI152NLin2009cAsym"

[nipype]
crashfile_format = "txt"
get_linked_libs = false
local_hash_check = true
nprocs = 10
omp_nthreads = 10
plugin = "MultiProc"
remove_node_directories = false
resource_monitor = false
stop_on_first_crash = true

[settings]
file_path = "/Users/martinnorgaard/Documents/GitHub/mriqc/mriqc/data/pet/derivatives/mriqc/logs/config-20250509-150839_62d91c5f-fc2a-4ed5-87b2-8c474d5e033e.toml"
start_time = 1746796119.322388

[execution.bids_filters]

[workflow.biggest_file_gb]
pet = 0.04553897213190794

[nipype.plugin_args]
maxtasksperchild = 1
raise_insufficient = false
n_procs = 10
11 changes: 11 additions & 0 deletions mriqc/data/pet/derivatives/petprep_hmc/dataset_description.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"Name": "PETPrep HMC workflow",
"DatasetType": "derivative",
"BIDSVersion": "1.7.0",
"GeneratedBy": [
{
"Name": "petprep_hmc",
"Version": "0.0.10"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
trans_x trans_y trans_z rot_x rot_y rot_z max_x max_y max_z max_tot median_tot
0 0.042524 0.033254 0.201559 0.005093 0.002339 0.001308 0.13510399999999834 0.39417200000000463 0.31259900000000584 0.4144521632577178 0.24044795261758672
1 0.042524 0.033254 0.201559 0.005093 0.002339 0.001308 0.13510399999999834 0.39417200000000463 0.31259900000000584 0.4144521632577178 0.24044795261758672
2 0.042524 0.033254 0.201559 0.005093 0.002339 0.001308 0.13510399999999834 0.39417200000000463 0.31259900000000584 0.4144521632577178 0.24044795261758672
3 0.042524 0.033254 0.201559 0.005093 0.002339 0.001308 0.13510399999999834 0.39417200000000463 0.31259900000000584 0.4144521632577178 0.24044795261758672
4 0.062664 0.167271 -0.256301 0.00418 0.003669 0.002652 0.2502160000000089 0.388264999999997 0.5241060000000033 0.6028335918327759 0.3463396698610647
5 0.168891 0.343776 -0.780523 0.000624 0.003962 0.001453 0.2699439999999953 0.3434820000000016 0.7194990000000061 0.799197440563345 0.63273720463041
6 0.106591 0.272566 -0.564354 0.000642 0.002471 0.000904 0.1644629999999978 0.2901329999999973 0.5417169999999984 0.6110877928898555 0.5080529114299173
7 0.13754 0.27817 -0.548284 0.001489 0.003523 0.00127 0.21731200000000683 0.34546000000000276 0.5598179999999999 0.6425998955306523 0.4926435889280838
8 0.174567 0.222818 -0.554918 0.001433 0.003675 0.001076 0.23878399999999544 0.2927350000000004 0.5558189999999996 0.618726189759256 0.465822407279853
9 0.147141 0.287726 -0.520696 0.000968 0.00332 0.001259 0.21775800000000345 0.31749599999999845 0.4967269999999999 0.5849997671324294 0.44919262281229305
10 0.135763 0.294311 -0.862506 -0.002533 0.003885 0.001593 0.23634099999999592 0.20630599999999788 0.6611520000000013 0.6748301069350773 0.4783911898636546
11 0.133987 0.316514 -0.895106 -0.004445 0.003294 0.001094 0.20574100000000328 0.2536970000000025 0.6721299999999957 0.6796346486296888 0.4418570389321888
12 0.128307 0.301193 -0.836072 -0.004811 0.003721 0.001356 0.21856700000000728 0.22622900000000357 0.5877809999999997 0.5904814613203331 0.3421570358811808
13 0.092678 0.187613 -0.553462 -0.003839 0.003561 0.00176 0.21528600000000608 0.2772340000000071 0.3308460000000011 0.3442636194894741 0.1966820596826297
14 -0.041942 0.116471 -0.263375 -0.003876 0.00214 0.001622 0.15661199999999553 0.3395190000000028 0.3210550000000012 0.4017416189953524 0.23365494368620213
15 0.004062 -0.070845 -0.16049 -0.004344 0.001881 0.00033 0.14010300000000342 0.46297400000000266 0.45114199999999727 0.5742322447163773 0.389676632863509
16 0.007914 -0.104361 -0.187322 -0.005488 0.001501 -4.3e-05 0.1222270000000023 0.5696659999999909 0.5147029999999972 0.6719007325111281 0.4528683969156977
17 -0.076009 -0.128338 0.00757 -0.005087 0.001424 0.000657 0.16710299999999734 0.6089350000000024 0.6598400000000026 0.8121806209144716 0.5925741595733051
18 -0.073613 -0.212594 0.01942 -0.004817 0.001732 0.000646 0.19015100000000018 0.6689420000000084 0.667942999999994 0.8669613148820281 0.6566910918807108
19 -0.019034 -0.430565 0.448751 -0.002102 0.001828 -0.000195 0.1856509999999929 0.5980779999999939 0.8220900000000029 0.9870592088841462 0.8726034584787558
20 -0.016395 -0.801118 0.663921 -0.004665 -0.003338 -0.003624 0.28188299999999344 1.0198799999999935 0.9927750000000017 1.3441046995145112 1.0747232794021842
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"Description": "Motion-corrected PET file",
"Sources": "/Users/martinnorgaard/Downloads/eddymotion_pet_testdata/data/sub-01/ses-baseline/pet/sub-01_ses-baseline_pet.nii.gz",
"ReferenceImage": "Robust template using mri_robust_register",
"CostFunction": "ROB",
"MCTreshold": "20",
"MCFWHM": "10",
"MCStartTime": "60",
"QC": "",
"SoftwareName": "PETPrep HMC workflow",
"SoftwareVersion": "0.0.10",
"CommandLine": "run.py /Users/martinnorgaard/Downloads/eddymotion_pet_testdata/data/ /Users/martinnorgaard/Downloads/eddymotion_pet_testdata/data/derivatives/petprep_hmc participant --n_procs 6 --mc_start_time 60"
}
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<html><head><title>Motion Correction Report</title></head><body><h2>PET with Motion Correction</h2><p>PET scan with motion correction applied. This shows the stabilized sequence.
</p><img src='sub-01_ses-baseline_desc-with_motion_correction.gif' style='width:100%; max-width:600px'><br><h2>PET without Motion Correction</h2><p>Original PET scan without any motion correction. Notice the movements affecting the quality.
</p><img src='sub-01_ses-baseline_desc-without_motion_correction.gif' style='width:100%; max-width:600px'><br><h2>Movement Metrics</h2><p>Overall movement metrics over time.
</p><img src='sub-01_ses-baseline_desc-movement.png' style='width:100%; max-width:600px'><br><h2>Rotation Metrics</h2><p>Rotation components of motion correction.
</p><img src='sub-01_ses-baseline_desc-rotation.png' style='width:100%; max-width:600px'><br><h2>Translation Metrics</h2><p>Translation components of motion correction.
</p><img src='sub-01_ses-baseline_desc-translation.png' style='width:100%; max-width:600px'><br></body></html>
Binary file not shown.
Empty file.
Binary file not shown.
Loading
Loading