ASL with multiple PLDs and single M0scan in BIDS

Hi,

Can you advise me on this, please? I have pcASL dataset with multiple, (5) PLDs which are separate images per PLD with different numbers of volumes. Is this okay to use pld with _acq? [ eg; sub-2001_ses-01N_acq-1200msPLD_asl.nii.gz]

In this dataset. m0scan is a separate image. I tried to include all the pld images with β€˜IntendedFor’ in m0scan.json file. looks like the validator expects each pld image will have a separate m0scan??

 "IntendedFor": [
    "perf\sub-2001_ses-01N_acq-200msPLD_asl.nii.gz",
    "perf\sub-2001_ses-01N_acq-700msPLD_asl.nii.gz",
    "perf\sub-2001_ses-01N_acq-1200msPLD_asl.nii.gz",
    "perf\sub-2001_ses-01N_acq-1700msPLD_asl.nii.gz",
    "perf\sub-2001_ses-01N_acq-2200msPLD_asl.nii.gz"
  ]

Is there any way to curate separate ASL images for multiple plds and single m0 in BIDS without combining images?

Thank you.

BW,
Ru

Hi @Pradeepa_Ruwan,

Please return the output from the validator, making sure you are using the latest version available.

Best,
Steven

Hi,
Thanks, I use 1.12 for validating. I get the following error;

Error 3: [Code 202] M0Type_SET_INCORRECTLY
Click here for more information about this issue

M0Type was not defined correctly. If 'M0Type' is equal to separate, the dataset should include a *_m0scan.nii[.gz] and *_m0scan.json file.5 files
sub-2001_ses-01N_acq-1200msPLD_asl.nii.gz1092.052 KB | application/gzip
Location:
BIDS_SPMIC/sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-1200msPLD_asl.nii.gz

Reason:
'M0Type' property of this asl ('/sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-1200msPLD_asl.nii.gz') does not point to an existing file('/sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-1200msPLD_m0scan.nii.gz'). Please mind that this value should not include subject level directory ('/sub-2001/').

Evidence:
/sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-1200msPLD_m0scan.nii.gz

sub-2001_ses-01N_acq-1700msPLD_asl.nii.gz1826.603 KB | application/gzip
Location:
BIDS_SPMIC/sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-1700msPLD_asl.nii.gz

Reason:
'M0Type' property of this asl ('/sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-1700msPLD_asl.nii.gz') does not point to an existing file('/sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-1700msPLD_m0scan.nii.gz'). Please mind that this value should not include subject level directory ('/sub-2001/').

Evidence:
/sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-1700msPLD_m0scan.nii.gz

sub-2001_ses-01N_acq-200msPLD_asl.nii.gz1092.947 KB | application/gzip
Location:
BIDS_SPMIC/sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-200msPLD_asl.nii.gz

Reason:
'M0Type' property of this asl ('/sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-200msPLD_asl.nii.gz') does not point to an existing file('/sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-200msPLD_m0scan.nii.gz'). Please mind that this value should not include subject level directory ('/sub-2001/').

Evidence:
/sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-200msPLD_m0scan.nii.gz

sub-2001_ses-01N_acq-2200msPLD_asl.nii.gz2732.813 KB | application/gzip
Location:
BIDS_SPMIC/sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-2200msPLD_asl.nii.gz

Reason:
'M0Type' property of this asl ('/sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-2200msPLD_asl.nii.gz') does not point to an existing file('/sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-2200msPLD_m0scan.nii.gz'). Please mind that this value should not include subject level directory ('/sub-2001/').

Evidence:
/sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-2200msPLD_m0scan.nii.gz

sub-2001_ses-01N_acq-700msPLD_asl.nii.gz1094.079 KB | application/gzip
Location:
BIDS_SPMIC/sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-700msPLD_asl.nii.gz

Reason:
'M0Type' property of this asl ('/sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-700msPLD_asl.nii.gz') does not point to an existing file('/sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-700msPLD_m0scan.nii.gz'). Please mind that this value should not include subject level directory ('/sub-2001/').

Evidence:
/sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-700msPLD_m0scan.nii.gz

Thanks,
Ru

one thing to try but not sure if the validator handle this yet: use bids_uri when writing the intended_for

https://bids-specification.readthedocs.io/en/latest/modality-specific-files/magnetic-resonance-imaging-data.html#using-intendedfor-metadata

"IntendedFor": [
    "bids::sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-200msPLD_asl.nii.gz",
    "bids::sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-700msPLD_asl.nii.gz",
    "bids::sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-1200msPLD_asl.nii.gz",
    "bids::sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-1700msPLD_asl.nii.gz",
    "bids::sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-2200msPLD_asl.nii.gz"
  ]

Also from reading the spec about M0 scans it seems that you can have one of them for several scans.

https://bids-specification.readthedocs.io/en/latest/modality-specific-files/magnetic-resonance-imaging-data.html#m0scan-metadata-fields

I can’t seem to reproduce your issue with one of the bids examples I have modified:

asl002
β”œβ”€β”€ dataset_description.json
β”œβ”€β”€ README
└── sub-Sub103
    β”œβ”€β”€ anat
    β”‚   β”œβ”€β”€ sub-Sub103_T1w.json
    β”‚   └── sub-Sub103_T1w.nii.gz
    └── perf
        β”œβ”€β”€ sub-Sub103_acq-foo2_aslcontext.tsv
        β”œβ”€β”€ sub-Sub103_acq-foo2_asl.json
        β”œβ”€β”€ sub-Sub103_acq-foo2_asl.nii.gz
        β”œβ”€β”€ sub-Sub103_acq-foo_aslcontext.tsv
        β”œβ”€β”€ sub-Sub103_acq-foo_asl.json
        β”œβ”€β”€ sub-Sub103_acq-foo_asllabeling.jpg
        β”œβ”€β”€ sub-Sub103_acq-foo_asl.nii.gz
        β”œβ”€β”€ sub-Sub103_m0scan.json
        └── sub-Sub103_m0scan.nii.gz

modified the M0 json to give me this

cat asl002/sub-Sub103/perf/sub-Sub103_m0scan.json 
{"Manufacturer":"Philips",
"ManufacturersModelName":"Achieva",
"SoftwareVersions":"5.1.7_5.1.7.2",
"MagneticFieldStrength":3,
"ReceiveCoilName":"MULTI_COIL",
"MRAcquisitionType":"2D",
"PulseSequenceType":"EPI",
"ScanningSequence":"GR",
"SequenceVariant":"SK",
"ScanOptions":"FS",
"PulseSequenceDetails":"Philips 2D epi pcasl product",
"PartialFourier":0.421875,
"PhaseEncodingDirection":"j",
"TotalReadoutTime":0.02198740305218437,
"EchoTime":0.015001,
"SliceTiming":[0,0.0385,0.077,0.1155,0.154,0.1925,0.231,0.2695,0.308,0.3465,0.385,0.4235,0.462,0.5004999999999999,0.539,0.5775,0.616,0.6545,0.6929999999999999,0.7315],
"FlipAngle":90,
"RepetitionTimePreparation":9,
"IntendedFor":["perf/sub-Sub103_acq-foo_asl.nii.gz", 
               "perf/sub-Sub103_acq-foo2_asl.nii.gz"]
}

bids validator gives me this (the code 36 errors is expected on the bids examples as they are empty files)

bids-validator asl002                            
bids-validator@1.11.1-dev.0
        1: [ERR] This file is too small to contain the minimal NIfTI header. (code: 36 - NIFTI_TOO_SMALL)
                ./sub-Sub103/anat/sub-Sub103_T1w.nii.gz
                ./sub-Sub103/perf/sub-Sub103_acq-foo2_asl.nii.gz
                ./sub-Sub103/perf/sub-Sub103_acq-foo_asl.nii.gz
                ./sub-Sub103/perf/sub-Sub103_m0scan.nii.gz

        Please visit https://neurostars.org/search?q=NIFTI_TOO_SMALL for existing conversations about this issue.

        Summary:                  Available Tasks:        Available Modalities: 
        13 Files, 133.03KB                                MRI                   
        1 - Subject                                                             
        1 - Session                                                             


        If you have any questions, please post on https://neurostars.org/tags/bids.
1 Like

getting the same results after updating to the latest version of the validator

bids-validator asl002
bids-validator@1.12.0
(node:117140) Warning: Closing directory handle on garbage collection
(Use `node --trace-warnings ...` to show where the warning was created)
        1: [ERR] This file is too small to contain the minimal NIfTI header. (code: 36 - NIFTI_TOO_SMALL)
                ./sub-Sub103/anat/sub-Sub103_T1w.nii.gz
                ./sub-Sub103/perf/sub-Sub103_acq-foo1_asl.nii.gz
                ./sub-Sub103/perf/sub-Sub103_acq-foo_asl.nii.gz
                ./sub-Sub103/perf/sub-Sub103_m0scan.nii.gz

        Please visit https://neurostars.org/search?q=NIFTI_TOO_SMALL for existing conversations about this issue.

        Summary:                  Available Tasks:        Available Modalities: 
        13 Files, 133.01KB                                MRI                   
        1 - Subject                                                             
        1 - Session                                                             
1 Like

Hi,

Thanks for checking everything. Is there any clue what could be wrong with images (dicom/nifti) or headers?
Any feedback is much appreciated.

Thanks,
Ru

can you give us an output of the tree command of your dataset?

just in case this helps us spot something

Hi,

Thanks for this.

C:\USERS\PPZRW2\DOCUMENTS\TRANSFER_DATA\TESTING\BIDS_MTBI\BIDS_N
β”‚   .bidsignore
β”‚   CHANGES
β”‚   dataset_description.json
β”‚   participants.json
β”‚   participants.tsv
β”‚   README
β”‚
β”œβ”€β”€β”€code
β”œβ”€β”€β”€derivatives
β”œβ”€β”€β”€sourcedata
└───sub-2001
    └───ses-01N
        β”œβ”€β”€β”€anat
        β”œβ”€β”€β”€dwi
        β”œβ”€β”€β”€fmap
        β”‚       sub-2001_ses-01N_acq-asl_dir-AP_epi.json
        β”‚       sub-2001_ses-01N_acq-asl_dir-AP_epi.nii.gz
        β”‚
        β”œβ”€β”€β”€func
        β”œβ”€β”€β”€perf
        β”‚       sub-2001_ses-01N_acq-1200msPLD_asl.json
        β”‚       sub-2001_ses-01N_acq-1200msPLD_asl.nii.gz
        β”‚       sub-2001_ses-01N_acq-1200msPLD_aslcontext.tsv
        β”‚       sub-2001_ses-01N_acq-1700msPLD_asl.json
        β”‚       sub-2001_ses-01N_acq-1700msPLD_asl.nii.gz
        β”‚       sub-2001_ses-01N_acq-1700msPLD_aslcontext.tsv
        β”‚       sub-2001_ses-01N_acq-200msPLD_asl.json
        β”‚       sub-2001_ses-01N_acq-200msPLD_asl.nii.gz
        β”‚       sub-2001_ses-01N_acq-200msPLD_aslcontext.tsv
        β”‚       sub-2001_ses-01N_acq-2200msPLD_asl.json
        β”‚       sub-2001_ses-01N_acq-2200msPLD_asl.nii.gz
        β”‚       sub-2001_ses-01N_acq-2200msPLD_aslcontext.tsv
        β”‚       sub-2001_ses-01N_acq-700msPLD_asl.json
        β”‚       sub-2001_ses-01N_acq-700msPLD_asl.nii.gz
        β”‚       sub-2001_ses-01N_acq-700msPLD_aslcontext.tsv
        β”‚       sub-2001_ses-01N_m0scan.json
        β”‚       sub-2001_ses-01N_m0scan.nii.gz
        β”‚
        └───swi

Thanks,
Ru

OK I think I managed to reproduce this.

Here is the modified bids example.

asl002_with_session
β”œβ”€β”€ dataset_description.json
β”œβ”€β”€ README
└── sub-Sub103
    └── ses-01N
        β”œβ”€β”€ anat
        β”‚   β”œβ”€β”€ sub-Sub103_ses-01N_T1w.json
        β”‚   └── sub-Sub103_ses-01N_T1w.nii.gz
        └── perf
            β”œβ”€β”€ sub-Sub103_ses-01N_aslcontext.tsv
            β”œβ”€β”€ sub-Sub103_ses-01N_asl.json
            β”œβ”€β”€ sub-Sub103_ses-01N_asllabeling.jpg
            β”œβ”€β”€ sub-Sub103_ses-01N_asl.nii.gz
            β”œβ”€β”€ sub-Sub103_ses-01N_m0scan.json
            └── sub-Sub103_ses-01N_m0scan.nii.gz

With any of the following:

"IntendedFor":["ses-01N/sub-Sub103_ses-01N_asl.nii.gz"]
"IntendedFor":"ses-01N/sub-Sub103_ses-01N_asl.nii.gz"

I get an error that I did not see when not ignoring the nifti headers

bids-validator --ignoreNiftiHeaders asl002_with_session
bids-validator@1.12.0
        1: [ERR] 'IntendedFor' field needs to point to an existing file. (code: 37 - INTENDED_FOR)
                ./sub-Sub103/ses-01N/perf/sub-Sub103_ses-01N_m0scan.nii.gz
                        Evidence: ses-01N/sub-Sub103_ses-01N_asl.nii.gz

        Please visit https://neurostars.org/search?q=INTENDED_FOR for existing conversations about this issue.

        1: [WARN] It is recommended to define 'AcquisitionVoxelSize' for this file. 'AcquisitionVoxelSize' is an array of numbers with a length of 3, in millimeters. This parameter denotes the original acquisition voxel size, excluding any inter-slice gaps and before any interpolation or resampling within reconstruction or image processing. Any point spread function effects (e.g. due to T2-blurring) that would decrease the effective resolution are not considered here. (code: 143 - ACQUISITION_VOXELSIZE_MISSING)
                ./sub-Sub103/ses-01N/perf/sub-Sub103_ses-01N_m0scan.nii.gz

        Please visit https://neurostars.org/search?q=ACQUISITION_VOXELSIZE_MISSING for existing conversations about this issue.

        Summary:                  Available Tasks:        Available Modalities: 
        10 Files, 131.31KB                                MRI                   
        1 - Subject                                                             
        1 - Session        

If I change the intended for to use bids URI then the error disappears:

"IntendedFor":"bids::sub-Sub103/ses-01N/sub-Sub103_ses-01N_asl.nii.gz"

or

"IntendedFor": ["bids::sub-Sub103/ses-01N/sub-Sub103_ses-01N_asl.nii.gz"]

then the error disappears:

bids-validator --ignoreNiftiHeaders asl002_with_session
bids-validator@1.12.0
(node:43133) Warning: Closing directory handle on garbage collection
(Use `node --trace-warnings ...` to show where the warning was created)
        1: [WARN] It is recommended to define 'AcquisitionVoxelSize' for this file. 'AcquisitionVoxelSize' is an array of numbers with a length of 3, in millimeters. This parameter denotes the original acquisition voxel size, excluding any inter-slice gaps and before any interpolation or resampling within reconstruction or image processing. Any point spread function effects (e.g. due to T2-blurring) that would decrease the effective resolution are not considered here. (code: 143 - ACQUISITION_VOXELSIZE_MISSING)
                ./sub-Sub103/ses-01N/perf/sub-Sub103_ses-01N_m0scan.nii.gz

        Please visit https://neurostars.org/search?q=ACQUISITION_VOXELSIZE_MISSING for existing conversations about this issue.

        Summary:                  Available Tasks:        Available Modalities: 
        10 Files, 131.33KB                                MRI                   
        1 - Subject                                                             
        1 - Session                                                             


        If you have any questions, please post on https://neurostars.org/tags/bids.

try changing the way you list the files in β€œintended for”

Hi,

Thanks for looking into this matter again. I tried so many alternatives though, I still get the same error. I just want to make sure whether I am doing this right.

I set up β€˜IntendedFor’ like this only for one pld.

"IntendedFor":[ "bids::sub-2001\ses-01N\perf\sub-2001_ses-01N_acq-200msPLD_asl.nii.gz"]

In your case you haven’t put β€˜perf’ folder in your path. I tried both ways though I get the same error.

Error 2: [Code 202] M0Type_SET_INCORRECTLY
Click here for more information about this issue

M0Type was not defined correctly. If 'M0Type' is equal to separate, the dataset should include a *_m0scan.nii[.gz] and *_m0scan.json file.1 file
sub-2001_ses-01N_acq-200msPLD_asl.nii.gz1202.121 KB | application/gzip
Location:
BIDS_SPMIC/sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-200msPLD_asl.nii.gz

Reason:
'M0Type' property of this asl ('/sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-200msPLD_asl.nii.gz') does not point to an existing file('/sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-200msPLD_m0scan.nii.gz'). Please mind that this value should not include subject level directory ('/sub-2001/').

Evidence:
/sub-2001/ses-01N/perf/sub-2001_ses-01N_acq-200msPLD_m0scan.nii.gz

Can you spot any issue here?

Thank you.

Best regards,
Ru

OK maybe check the M0Type metadata in your sub-*_acq-*_asl.json

https://bids-specification.readthedocs.io/en/latest/glossary.html#objects.metadata.M0Type

the error message you are getting says it should be set to separate like in here

Hi,

This is very strange! It has been there this whole time. Can it be due to any other metadata missing here?
My Json sidecar looks like the one below.

"ArterialSpinLabelingType": "PCASL",
  "PulseSequenceType": "Gradient Echo EPI",
  "RepetitionTimePreparation": 3.58,
  "PostLabelingDelay": [
    0.2,
    0.2,
    0.2,
    0.2,
    0.2,
    0.2,
    0.2,
    0.2,
    0.2,
    0.2,
    0.2,
    0.2
  ],
  "BackgroundSuppression": false,
  "VascularCrushing": false,
  "AcquisitionVoxelSize": [
    3.4,
    3.4,
    5
  ],
  "SliceTiming": [
    0,
    1.55,
    0.129167,
    1.67917,
    0.258333,
    1.80833,
    0.3875,
    1.9375,
    0.516667,
    2.06667,
    0.645833,
    2.19583,
    0.775,
    2.325,
    0.904167,
    2.45417,
    1.03333,
    2.58333,
    1.1625,
    2.7125,
    1.29167,
    2.84167
  ],
  "M0Type": "Separate",
  "TotalAcquiredPairs": 12,
  "LabelingDuration": 1.4,
  "LabelingLocationDescription": "ACPC"
}

Thanks,
Ru

This is getting weirder and weirder. :stuck_out_tongue_closed_eyes:
OK.
Is there any way you can β€œshare” this dataset?

Given that I don’t need the actual data, you could just create a copy of a single participant and β€œtruncate” the data the same way we do it with the BIDS examples:

Thanks for sending the data.

I reproduce your bug and could modify one of the bids examples to also reproduce it there.

This is a bug in the validator in my opinion: will open an issue on the github repository of the validator.

Opened an issue here: ASL M0scan json "intended for": struggle with array of strings Β· Issue #1793 Β· bids-standard/bids-validator Β· GitHub

Thank you very much for this. appreciate a lot.

Best regards,
Ru

1 Like