Skip to content

Provide at least reading capability for AFNI's (BRIK/HEAD) format #310

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

Closed
yarikoptic opened this issue Apr 29, 2015 · 13 comments
Closed

Provide at least reading capability for AFNI's (BRIK/HEAD) format #310

yarikoptic opened this issue Apr 29, 2015 · 13 comments

Comments

@yarikoptic
Copy link
Member

AFNI is quite widely used, and ATM I know no library to load those volumetric files in Python. It would be really great if at least reading, even if limited (e.g. for a specific subbrick) capabilities were introduced.

@matthew-brett
Copy link
Member

Yo - do you have some files in this format you can share?

@ghost
Copy link

ghost commented Sep 21, 2015

Hi! I'm also interested in this feature and would be happy to (privately) share data files.

@ghost
Copy link

ghost commented Sep 22, 2015

AFNI is open source, but I don't know what license it has; it is likely less permissive than NiBabel's, so just translating its C code into Python is shady. It would not be a violation of AFNI's copyright if one programmer were to read their source and document the file format in order for a second programmer to write a python implementation.

I would happy to be either of these two programmers!

@yarikoptic
Copy link
Member Author

On Tue, 22 Sep 2015, Eamon Caddigan wrote:

AFNI is open source, but I don't know what license it has; it is likely less

FWIW AFNI core developments since 2000 is a product of NIH, ie.
USA goverment, so can't be copyrighted, thus public domain see
http://neuro.debian.net/debian/extracts/afni/copyright so depending on
which piece you are talking about it might be even more permissive than
nibabel ;)

Yaroslav O. Halchenko
Center for Open Neuroscience http://centerforopenneuroscience.org
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834 Fax: +1 (603) 646-1419
WWW: http://www.linkedin.com/in/yarik

@effigies
Copy link
Member

Might also be worth noting that there are publicly available .BRIK/.HEAD files in http://afni.nimh.nih.gov/pub/dist/src/

@bcipolli
Copy link
Contributor

Just received some BRIK/HEAD files to work with. Has anybody looked at code snippets to make this happen, or should I find them myself?

@bcipolli
Copy link
Contributor

I was able to load my file using a MATLAB implementation here:
http://afni.nimh.nih.gov/pub/dist/src/matlab/BrikLoad.m

Perhaps we can port this to Python? Does anybody know reliable tools to convert code to get a head start?

@yarikoptic
Copy link
Member Author

On Sun, 20 Dec 2015, Ben Cipollini wrote:

I was able to load my file using a MATLAB implementation here:
[1]http://afni.nimh.nih.gov/pub/dist/src/matlab/BrikLoad.m

Perhaps we can port this to Python? Does anybody know reliable tools to convert
code to get a head start?

FWIW, whenever last time I had to convert some matlab code over to
python I just did interactive replacement of () with [] and 1 with 0 for
a good head start and then just going through code. If it was old
enough many repmat's (or whatever it was) were adopted as numpy
broadcastings ;) overall wasn't too painful, just quite a bit of work

the question here would also be what would be the best way to fit this
beast within nibabel hierarchy. those multi-brik BRIKs and extensions
of all kinds (like provenance logs) -- in the long run ideally nibabel's
API should be able to expose them all

@bcipolli
Copy link
Contributor

Agreed. To start with, I hope a PR for the most simple case (reading single BRIK/HEAD pairs) would be acceptable, as that's all the time I'll really have for.

@njmei-brown
Copy link

This is actually a project that I played around with a bit when I was first learning python some years back... there is absolutely no guarantee that this code still works or that it worked properly in the first place! So, user beware!

https://github.com/njmei/AFNI-Python-IO/blob/master/AFNIPyIO.py

To my knowledge though, most people use the native AFNI functions to convert the .BRIK and .HEAD files to .nifti and load into python with nibabel that way...

@bcipolli
Copy link
Contributor

Nice. I will give that a try in the next couple of weeks!

@yarikoptic
Copy link
Member Author

Was I dreaming that there was already a PR with BRIKs support?

@effigies
Copy link
Member

Closed by #561.

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

No branches or pull requests

5 participants