Skip to content

NIfTIs import #1300

@HenkMutsaerts

Description

@HenkMutsaerts

Description

Return the original ability to import NIfTIs, which was removed when we added NIfTI2BIDS to the import module. ExploreASL’s import should work with pre-existing NIfTIs. If these don’t have a JSON sidecar, this is not BIDS compliant and thus not desired, but we should support it. Anatomical scans that are NIfTI-only should be supported.

Tasks

  • NIfTIs in import should be dealt with, by using sourceStructure.json>bMatchDirectories:false and \.nii as last token.
  • xASL_imp_DCM2NII_ConvertScan line 82 and further, it detects the scantype.
    T1w was not recognised here, which is why it came into a session folder (T1w_1) like ASL,
    which NII2BIDS expects in xASL_wrp_NII2BIDS_Subject > line 42
    (so I didn’t fix this) Otherwise, this is hacked such that it can survive NIfTIs without JSONs.
    Unsure how this relates to Incorrectly import and BIDS2Legacy of multiple anatomical images. #1288.
  • xASL_wrp_NII2BIDS_Subject > listRuns should also detect T1 (not only T1w)
  • xASL_imp_ReadSourceData > Shoulld recognise .nii file extension
  • xASL_imp_DCM2NII_Subject_StartConversion > destination should be zipped
  • xASL_imp_DCM2NII_Subject_StartConversion line 31 has a bug. If bSkipThisOne is true (which it probably isn't anymore after Michael's import revamp), it will try to access undefined variables iSubject iVisit etc. Easiest solution is to just add these variables to the input variables, but perhaps we can remove bSkipThisOne completely, if this simplifies the code. -> fixed by Minor GE flavor bugs #1294
  • Only create a rawdata subfolder (e.g., perf) if we move NIfTIs there
    -> xASL_adm_CreateDir should be removed at xASL_imp_NII2BIDS_Run > line 44 & line 56, because this will create the folder whether this folder will be populated or not
    Rather, this should happen in the ASLBIDSify functions (where the JSON & NIfTIs are moved. I did some changes for this, but @jan-petr you should check where the ASL folder needs to be created and change this. Alternatively, we move this to a future issue if this is too complicated.
  • Allow importing both .nii and .nii.gz; when either .nii or .nii.gz is provided, it should import both .nii and .nii.gz
    -> when detecting nii at the end, it should become (nii|nii.gz)
  • @jan-petr Add new NIfTI flavor to flavordatabase (see branch NIfTIs import #1300 in /FlavorDatabase/DDI_Siemens_Skyra_E11_NIfTI_Only)
  • In the flavor - convert manually TXT sidecars to JSONs
  • Test the flavor to see if JSONs are also copied
  • Unverified commits have to be fixed before merging

This also closes duplicate #1128.

Minor

  • xASL_bids_CompleteBIDS2Legacy gave confusing messages; stemming from Michael Stritt taking running import before ExploreASL processing as default behavior (whereas default behavior should be running the pipeline separate, with BIDS as input)

There is a dataPar.ison in derivatives already.
Overwriting x.dir.dataPar...

  • heads up when dataPar.json already existed, which should be default behavior, so I removed this
  • it said it overwrote x.dir.dataPar, which can confuse the user as if a file is overwritten, so I removed this

How to test

Import the new dataset /FlavorDatabase/DDI_Siemens_Skyra_E11_NIfTI_Only which has only NIfTIs. There will be warnings because of the JSON lacking, which I believe we should keep (it is not BIDS compliant so not really supported behavior).

Check to sync this with #1128.

Release notes

Allow direct import of NIfTIs.

Metadata

Metadata

Assignees

Labels

featureNew feature, enhancement or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions