Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CalledProcessError newest version #54

Closed
nmarkowitz opened this issue May 23, 2019 · 2 comments
Closed

CalledProcessError newest version #54

nmarkowitz opened this issue May 23, 2019 · 2 comments

Comments

@nmarkowitz
Copy link

Hi, I just tried the newest version of dcm2bids and I occasionally get the following error

Error: Photometric Interpretation 'PALETTE COLOR' not supported
Traceback (most recent call last):
  File "/home/stephan/miniconda2/envs/dcm2bids/bin/dcm2bids", line 114, in <module>
    sys.exit(main())
  File "/home/stephan/miniconda2/envs/dcm2bids/bin/dcm2bids", line 110, in main
    return app.run()
  File "/home/stephan/miniconda2/envs/dcm2bids/lib/python3.7/site-packages/dcm2bids/dcm2bids.py", line 103, in run
    dcm2niix.run(self.forceDcm2niix)
  File "/home/stephan/miniconda2/envs/dcm2bids/lib/python3.7/site-packages/dcm2bids/dcm2niix.py", line 91, in run
    self.execute()
  File "/home/stephan/miniconda2/envs/dcm2bids/lib/python3.7/site-packages/dcm2bids/dcm2niix.py", line 104, in execute
    output = run_shell_command(cmd)
  File "/home/stephan/miniconda2/envs/dcm2bids/lib/python3.7/site-packages/dcm2bids/utils.py", line 109, in run_shell_command
    return check_output(shlex.split(commandLine))
  File "/home/stephan/miniconda2/envs/dcm2bids/lib/python3.7/subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "/home/stephan/miniconda2/envs/dcm2bids/lib/python3.7/subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['dcm2niix', '-b', 'y', '-ba', 'y', '-z', 'y', '-i', 'y', '-f', '%3s_%p_%z_%t', '-o', '/media/stephan/data_big/bids_data/tmp_dcm2bids/sub-NS143_ses-preimplant01', '/media/stephan/data_big/bids_data/sourcedata/sub-NS143/ses-preimplant01/MR']' returned non-zero exit status 1.

The dicoms get converted into niftis and stored in the tmp directory but then don't get renamed or any further processing. I've tried reinstalling a few times already. Any ideas what may be causing this? Thank you again for this app

@neurolabusc
Copy link

I have added a patch to the development version that should fix this issue:

git clone --branch development https://github.com/rordenlab/dcm2niix.git
cd dcm2niix
mkdir build && cd build
cmake ..
make

In the past, an error was generated, and I believe this terminates Dcm2Bids
printError("Photometric Interpretation 'PALETTE COLOR' not supported\n");
the new version should simply generate a warning and skip these images:
printWarning("Photometric Interpretation 'PALETTE COLOR' not supported\n");
Palette colors are always low precision, and do not have a direct equivalent in NIfTI. One could convert these to RGB images which do exist in NIfTI, but few NIfTI tools handle these and the precision remains low. In my experience, palette colors are only used for derived images, and therefore you want to skip these files and convert the high-precision raw data (which should yield better derived values after processing).

In my experience, palette colors is exceptionally rare. You may want to work out the providence of these images and see if there is a way to store them in more common format.

@nmarkowitz
Copy link
Author

I think I resolved this. I think it was the dicoms (possibly the way they were retrieved, stored, downloaded, not sure). It now works. There are a lot of derivatives that are included with the dicoms so I filter out using -i switch in dcm2niix. Thanks for all the help

yarikoptic added a commit to neurodebian/dcm2niix that referenced this issue May 6, 2020
* tag 'v1.0.20190720':
  Update dcm_qa submodule.
  Handle rare VRs (https://www.aliza-dicom-viewer.com/download/datasets)
  New default merge option "-m o" will merge CTs and segment MRIs (https://discourse.slicer.org/t/odd-dicom-import/7576)
  --progress option (rordenlab#314; rordenlab#312)
  Tune verbosity (rordenlab#312)
  GE Slice Timing From Protocol Data Block (rordenlab#311)
  Desparate guess of GE slice times from ProtocolDataBlock (clone dicm2nii, assumes TA close to TR)
  Support interleaved (rordenlab#309)
  Slice times from ucMode (rordenlab#309)
  GE number of slice discrepancy (rordenlab#306)
  Simplify slice timing code, develop stc validation (https://github.com/neurolabusc/dcm_qa_stc)
  hdr.vox_offset is a float not integer (https://www.nitrc.org/forum/message.php?msg_id=27155)
  BIDS tags for PASL fairest sequent
  Read 0019,1029 (rordenlab#296)
  Generate warning rather than error when palette colors are detected (UNFmontreal/Dcm2Bids#54)
  Update tinydir call (rordenlab#298)
  Bruker 4D datasets: correct slice ordering
  Bruker 4D datasets: Fix parametric maps grouping
  Changes up to divest v0.8.1
  Support isotropic scans for NRRD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants