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

Automatic placement of echo results in BIDS-invalid format #541

Closed
1 of 2 tasks
andrew-yian-sun opened this issue Feb 1, 2022 · 14 comments
Closed
1 of 2 tasks

Automatic placement of echo results in BIDS-invalid format #541

andrew-yian-sun opened this issue Feb 1, 2022 · 14 comments

Comments

@andrew-yian-sun
Copy link

Summary

I'm trying to get the following BIDS-valid output:
sub-0061_echo-1_part-mag_MEGRE.nii.gz Related Github issue at bids-specification: https://github.com/bids-standard/bids-specification/issues/979

However, it seems like echo is automatically generated by HeuDiConv to appear directly before _MEGRE, making it BIDS invalid (echo has to come before part).

The relevant part of my heuristic:
megre_mag = create_key('sub-{subject}/{session}/anat/sub-{subject}_{session}_part-mag_MEGRE')

I omit echo because it otherwise will generate 2 instances of echo in my output.

Platform details:

Choose one:

  • Local environment
  • Container: Docker, nipy/heudiconv:latest
  • Heudiconv version: 0.9.0
@pvelasco
Copy link
Contributor

pvelasco commented Feb 1, 2022

Hi @andrew-yian-sun ,
I can work on a fix. However, to test it, would you be able to provide a sample dataset?
Ideally, a very low resolution, just a few echoes, on a phantom.
Thanks,
-Pablo

@andrew-yian-sun
Copy link
Author

@pvelasco Yes, I'll try to get that to you tomorrow. Thanks!

@tsalo
Copy link
Member

tsalo commented Feb 2, 2022

@pvelasco It looks like the keyword you used in #542 didn't auto-close this issue. Now that #542 is merged, can this be closed?

@pvelasco
Copy link
Contributor

pvelasco commented Feb 2, 2022

I think so.

@tsalo
Copy link
Member

tsalo commented Feb 2, 2022

Sounds good. I'll close this now, but @andrew-yian-sun if you find that the problems persists, please feel free to follow up here.

@tsalo tsalo closed this as completed Feb 2, 2022
pvelasco added a commit to cbinyu/heudiconv that referenced this issue Feb 28, 2022
pvelasco added a commit to cbinyu/heudiconv that referenced this issue Feb 28, 2022
yarikoptic added a commit that referenced this issue Apr 5, 2022
@andrew-yian-sun
Copy link
Author

@tsalo I recently tried to the recent version of heudiconv, 0.10.0 but echo is still appearing in the wrong place:
it should be sub-001_ses-1_echo-1_part-mag_MEGRE
but I am being given: sub-001_ses-1_part-mag_echo-1_MEGRE

Is this issue still being fixed?

@tsalo
Copy link
Member

tsalo commented Apr 12, 2022

The issue should be fixed, but the most recent release, 0.10.0, was in October of last year, while the fix was merged in February of this year.

@yarikoptic is it maybe time for 0.11.0?

@pvelasco
Copy link
Contributor

Well, the problem is that I thought the echo entity came last, but I was mistaken 😞 : part is supposed to come after echo (BIDS v1.5.0 and later).

So I would need to fix that, but I'm a little time constrained right now. I'll try to fix it by the end of the week.

@yarikoptic
Copy link
Member

Thought to finish #544 before I do 0.11.0 but may be would need to cut it before then. That pr should make order follow bids schema thus guaranteed to be correct

@pvelasco
Copy link
Contributor

I take it back:
The fix works correctly: part comes after echo. We even check it explicitly in the tests
@tsalo was correct: the problem is that the fix came after 0.10.0 was released.

So @andrew-yian-sun, when 0.11.0 is released (soon, hopefully), this issue should be fixed. If you can't wait and have docker installed, you can do a docker build of the master branch and use that for now.

@andrew-yian-sun
Copy link
Author

@pvelasco is this the correct way to use docker build on the master branch?

docker build https://github.com/nipy/heudiconv/#master:heudiconv

If so, I get the following error:

[+] Building 0.0s (1/1) FINISHED                                                                                                         
 => [internal] load remote build context                                                                                            0.0s
failed to solve with frontend dockerfile.v0: failed to create LLB definition: dockerfile parse error line 7: unknown instruction: <!DOCTYPE

@pvelasco
Copy link
Contributor

Hi @andrew-yian-sun,

I haven't used docker build from URL before, so I'm not sure what the issue is.

From the docker build documentation, the correct command would be:

docker build https://github.com/nipy/heudiconv#master
  1. You don't need a / (slash) before the # (pound) specifying the branch.
  2. The :<dir> is used when you need to specify the build context (the folder with the files that Docker will use to build the image). For heudiconv, the build context is the repository root directory, so you don't need to specify it.

That said, using the command above returns a similar error:

Error response from daemon: dockerfile parse error line 7: unknown instruction: <!DOCTYPE

Just to check it, I downloaded a copy of the repo and tried to docker-build it from that local folder:

cd /tmp/
git clone --depth 1 -b master [email protected]:nipy/heudiconv.git
cd heudiconv/
docker build -t deleteme/heudiconv .

But that gave an error (at Step 11/13). So it looks like the Dockerfile might be broken. So I have opened a new issue (#562) to address it.

@andrew-yian-sun
Copy link
Author

@pvelasco Just tried heudiconv v0.11.1, which worked as intended, thanks all!

@pvelasco
Copy link
Contributor

Glad it worked!

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

4 participants