ASLprep using separate M0scan images

Hi,
I am trying out ASLprep to process PCASL images. I have separate M0scan images and a series of PCASL images.
But I failed to run the ASLperp within separate M0scan images, even it seems in BIDS format.
Later, I used FSL to merge M0scan and PCASL images, but compared to the PCASL images, my M0scan images have different scanning parameters (RepetitionTime),
I don’t know which TR parameter should be included in the asl.json file ?
Thanks,
Harry

folder tree

sub-01
├─ anat
│    ├─ sub-01_T1w.json
│    └─ sub-01_T1w.nii.gz
└─ perf
       ├─ sub-01_asl.json
       ├─ sub-01_asl.nii.gz
       └─ sub-01_aslcontext.tsv

if I use separate M0scan and asl data, like this

sub-01
├─ anat
│    ├─ sub-01_T1w.json
│    └─ sub-01_T1w.nii.gz
└─ perf
       ├─ sub-01_asl.json
       ├─ sub-01_asl.nii.gz
       ├─ sub-01_aslcontext.tsv
       ├─ sub-01_m0scan.json
       └─ sub-01_m0scan.nii.gz

the ASLprep error is

Errors
Node Name: aslprep_wf.single_subject_01_wf.asl_preproc_asl.compt_cbf_wf.extractcbf

Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 398, in run
    runtime = self._run_interface(runtime)
  File "/usr/local/miniconda/lib/python3.7/site-packages/aslprep/interfaces/cbf_computation.py", line 116, in _run_interface
    aslfile_linkedM0 = os.path.abspath(self.inputs.bids_dir+'/'+m0file_metadata['IntendedFor'])
KeyError: 'IntendedFor'

Thank you in adcance

Thank you for opening this @harrycheung. Would you mind posting (1) the folder tree for ones of the subjects in your BIDS dataset and (2) the relevant metadata for one of your runs (e.g., the M0scan and ASL files’ metadata, along with the contents of the aslcontext.tsv file)? If there’s any protected information in the metadata (e.g., subject information), you can exclude that from what you share.

it be solved, after I insert “IntendedFor” field in m0scan.jsons,

"IntendedFor": "sub-xx_asl.nii.gz"