Closed pbbaba closed 11 months ago
https://github.com/nipy/heudiconv/pull/708 should fix it. Meanwhile - just provide some bogus paths in --files
-- they will be ignored
But --files and -d options do not go together, and I need to provide -d option (--dicom_dir_template). Any solution on working without providing --files option?
the easiest: wait for that PR to be merged, then you can try/use nipy/heudiconv:master
instead of :latest
(which is the released version)
This led to the following error when I run the nipy/heudiconv:master
-
INFO: Running heudiconv version 1.0.0.post2+gaa4c785 latest 1.0.0
Traceback (most recent call last):
File "/opt/miniconda-py39_4.12.0/bin/heudiconv", line 8, in
Also this is not working with the command line tool. While using the command line for this tool, it gives me the same error that it gave while I posted this issue. Is there any way this can be implemented for the command line heudiconv?
not sure what you mean by "command line" as a separate thing from something else since heudiconv
is a command line tool and there is no other way (e.g. GUI). What did you mean?
In your invocation now just remove -d "data/{subject}/{session}//.dcm"
since it is not relevant when you specify --command populate-intended-for
-- it would operate on already converted data.
The installation method has local, docker and singularity type. I am using the local one using pip install heudiconv. Please refer to the documentation provided here: https://heudiconv.readthedocs.io/en/latest/installation.html I am using the first option i.e. Local
I am trying to get the conversion process and populate intended for run in one go. If I do not pass -d option how will it determine from where should it use the files for bids conversion.
Please refer to the below command that I am using:
heudiconv \ --dicom_dir_template 'staging/xxx/xxxx/xxx/{subject}/{session}/*/*/*.dcm' \ --subjects A0000000 \ --ses v1 \ --heuristic BIDS_output/code/heuristic.py \ --converter dcm2niix \ --bids \ --command populate-intended-for \ --outdir BIDS_output
ok. for clarity of terminology as I see it -- it is either "native" or "containerized" executions. All of them are "local" to me (e.g. if you used reproman
and made it execute on some server -- it would have been not local. containers are all running locally). In all cases all invocations remain done in "command line".
--command
for conversion etc to happen--command populate-intended-for
is intended to redo that particular step - population of IntendedFor e.g. if you modify the settings for it in the heuristic . Then it would just go through your BIDS_output
directory and thus you should not specify --dicom_dir_template
. FWIW I have merged https://github.com/nipy/heudiconv/pull/709 so in a few minutes whenever docker regenerates/pushes, if you pull that :master
image -- you would get a new behavior that even if you specify that option -- it will proceed but issue a warningIs it also applicable for python package heudiconv? (I am using pip install heudiconv
and not docker pull nipy/hueudiconv:master
and `docker run ...)
So if I used POPULATE_INTENDED_FOR_OPTS = { 'matching_parameters': ['ImagingVolume', 'Shims'], 'criterion': 'Closest' }
in my heuristic.py file and run the above mentioned command without adding --command populate-intended-for
, I should see that 'IntendedFor' flag is there in the .json files?
FYI the below screenshot shows how my heuristic.py file looks like.
So if I used
POPULATE_INTENDED_FOR_OPTS = { 'matching_parameters': ['ImagingVolume', 'Shims'], 'criterion': 'Closest' }
in my heuristic.py file and run the above mentioned command without adding--command populate-intended-for
, I should see that 'IntendedFor' flag is there in the .json files?
yes, if 'ImagingVolume', and 'Shims' matched ... if you don't see -- check sizes and Shimming in the .json files you get
Okay great! Thanks for your help, I will run this.
:rocket: Issue was released in v1.0.1
:rocket:
:rocket: Issue was released in v1.0.1
:rocket:
Summary
I am trying to use
--command populate-intended-for
with the command line tool. Also I have created the heuristic.py file and added the following in it -POPULATE_INTENDED_FOR_OPTS = { 'matching_parameters': ['ImagingVolume', 'Shims'], 'criterion': 'Closest' }
Following is the final command when I am running heudiconv using command line - docker run --rm -it \
-v /Users/pbaba1/Documents/Data/human/dicom/triotim/amayer/macip_20637:/data:ro \ -v /Users/pbaba1/Documents/BIDS:/output \ nipy/heudiconv:latest \ -d "data/{subject}/{session}//.dcm" \ -s M87100217 \ --command populate-intended-for -ss Study20160325at134915 \ -f /output/code/heuristic.py \ -c dcm2niix -b \ -o /output
However, when I run this it gives me the following error - INFO: Running heudiconv version 1.0.0 latest 1.0.0 Traceback (most recent call last): File "/opt/miniconda-py39_4.12.0/bin/heudiconv", line 8, in
sys.exit(main())
File "/src/heudiconv/heudiconv/cli/run.py", line 30, in main
workflow(kwargs)
File "/src/heudiconv/heudiconv/main.py", line 361, in workflow
raise ValueError("'command' given but 'files' is None")
ValueError: 'command' given but 'files' is None**
Is there something that I am missing? I could not find proper documentation that describes the
--command
option's correct usage. Please guide on this.