Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Use dcm2bids for conversion #89

Open
jcohenadad opened this issue May 22, 2020 · 9 comments
Open

Use dcm2bids for conversion #89

jcohenadad opened this issue May 22, 2020 · 9 comments

Comments

@jcohenadad
Copy link
Member

https://github.com/cbedetti/Dcm2Bids

@jcohenadad
Copy link
Member Author

jcohenadad commented May 22, 2020

Example of code to add in the config file that could accommodate our fieldmaps

        {
            "dataType": "fmap",
            "modalityLabel": "fmap",
            "SeriesDescription": "a_gre_DYNshim",
            "modalityLabel": "phase",
            "criteria": {
                "SeriesDescription": "a_gre_*",
                "ImageType": "*P*". # --> THAT DOES NOT SEEM TO WORK
              }
        },

@gaspardcereza
Copy link
Member

It seems that dcm2bids is not compatible with Windows.
https://neurostars.org/t/dicom-to-bids-conversion-on-windows/5009

@jcohenadad
Copy link
Member Author

It seems that dcm2bids is not compatible with Windows.
https://neurostars.org/t/dicom-to-bids-conversion-on-windows/5009

the answer is in the thread: Heudiconv seems to work in windows

@gaspardcereza
Copy link
Member

the answer is in the thread: Heudiconv seems to work in windows

So do you propose to work with Heudiconv instead of dcm2bids ? Or just to include a "if" in the code that switches to Heudiconv if we run matlab from Windows ?

@jcohenadad
Copy link
Member Author

the answer is in the thread: Heudiconv seems to work in windows

So do you propose to work with Heudiconv instead of dcm2bids ?

yup!

Or just to include a "if" in the code that switches to Heudiconv if we run matlab from Windows ?

omg, no "if" please 😅

@kousu
Copy link
Contributor

kousu commented May 26, 2020

dcm2bids does run on Windows. If you run python path/to/dcm2bids it goes. The problem is that, for some reason, the package up on PyPI wants to install it as dcm2bids2. This name occurs on Linux too:

$ sudo pip uninstall dcm2bids
Found existing installation: dcm2bids 2.1.4
Uninstalling dcm2bids-2.1.4:
  Would remove:
    /usr/bin/dcm2bids
    /usr/bin/dcm2bids2
    /usr/bin/dcm2bids_helper
    /usr/bin/dcm2bids_scaffold
    /usr/lib/python3.8/site-packages/dcm2bids-2.1.4.dist-info/*
    /usr/lib/python3.8/site-packages/dcm2bids/*

it's just, for some reason, on Windows the other scripts aren't wrapped in a .exe, even though they are copied to the Scripts\ folder. So it's not quite packaged properly but we can get that fixed if we raise it as a bug with them.

I tried to do pip install heudiconv on Windows and after it downloaded a huge number of dependencies it crashed at "Microsoft Visual C++ 14.0 is required", presumably to compile one of the dependencies. I would rather get dcm2bids fixed than fight with that.

@kousu
Copy link
Contributor

kousu commented May 26, 2020

Okay so here's the deal:

the version on pypi is broken, but only for Windows: UNFmontreal/Dcm2Bids#79; it hasn't been updated in over a year though.

Conversely, the latest HEAD source version which has been getting work since the last PyPI publish, does work for Windows, except it is broken worse: UNFmontreal/Dcm2Bids#76.

If we can solve UNFmontreal/Dcm2Bids#76 for them then we can it working on Windows. EDIT: fixed UNFmontreal/Dcm2Bids#80


@gaspardcereza, please try this command:

pip uninstall dcm2bids
pip install dcm2bids@git+git://github.com/kousu/Dcm2Bids@package-find_packages

I had to patch it to get it working, so you have to install my unofficial version, but that line should get you a working copy of the tool. When the original author has some time hopefully they'll be able to republish a working copy directly to pypi. And definitely record this line in your Windows-compatiblity notebook.

@jcohenadad
Copy link
Member Author

If we can solve UNFmontreal/Dcm2Bids#76 for them then we can it working on Windows. EDIT: fixed UNFmontreal/Dcm2Bids#80

@gaspardcereza that would be a good coding exercise for your 😊

@gaspardcereza
Copy link
Member

@gaspardcereza that would be a good coding exercise for your 😊

I'm currently having a look at it but it seems that Nick already solved the problem by importing the subpackages ! 😉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants