Skip to content

macOS dcm2nii error #1273

@HenkMutsaerts

Description

@HenkMutsaerts

Description

macOS Flavordatabase is crashing (xASL_io_dcm2nii)

Tasks

  • Add quotes in xASL_SysMove instead of escaping
  • xASL_bids_BIDSifyASLJSON should check for empty fields and issue a warning (which points to dcmtk not having parsed nicely), otherwise we will get a non-specific error on fields that don't have an equal size for && or ||
  • We could enforce a bash environment (macOS's default is zsh I believe):
    setenv('SHELL', '/bin/bash')
  • Run flavors on old Mac
  • Run flavors on new Mac
  • rebase on Compilation dcmTK MEX on Apple #1379
  • rebase on GE enhanced ASL 7 PLDs check #1516
  • @jan-petr fix dcm2tk compilation issues in macOS (also for the intel version)

The brackets don't crash. The output of dcm2nii for GE product is the same on macOS (ZSH) and RedHat Linux (BASH).

S_007_[3D_ASL]_removed_20000101164456_7_1_real.nii
and
S_007_[3D_ASL]_removed_20000101164456_7_37_real.nii

and somehow xASL_io_dcm2nii_FixFormat wants to turn this into:

S_007_[3D_ASL]_removed_20000101164456_7_1_real00000_e00000.nii
and
S_007_[3D_ASL]_removed_20000101164456_7_37_real00000_e00000.nii

So my questions are:

  1. What should xASL_io_dcm2nii_FixFormat do? It says "Fix NIfTI and JSON file names (uneven length etc.)" What is the reason for this renaming?

  2. Why can't we skip the renaming, and use a regular expression in the subsequent code to detect the files?
    JAN: There was some issue with special characters in file names I think. So renaming was necessary to make it work with dcm2nii. Regexp won’t help cause this is not about internal Matlab stuff but about dcm2nii
    HENK: then we have to improve this behavior, as it doesn't work in all systems (see the above example)

  3. The renaming doesn't work because mac's bash (ZSH) doesn't like the name, when we add the quotes in xASL_SysMove, it would work. I suggest adding these.

HENK: OK then we have to improve the renaming

I would generalize the handling of special characters in filenames, at least now in xASL_Sys(Move|Copy), since there could be more Linux flavors that will have this problem, other than macOS, see also HERE.

How to test

Optional: insert description about how to test the code changes here

Release notes

Required: summarize the changes for the release notes here

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions