-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[brainbrowser] Add possibility to read nii.gz files with BB #5314
Conversation
@@ -53,7 +53,7 @@ | |||
header('Content-Type: application/x-mnc'); | |||
} | |||
header('X-FileID: ' . $_REQUEST['file_id']); | |||
readfile($image_path); | |||
readgzfile($image_path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this going to break 1. minc and 2. non-gzipped .nii
files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@driusan Should not. File that are not in gz
format are read as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@driusan as @PapillonMcGill mentioned, .mnc and .nii files can still be open with BB. I tested it before sending the PR :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
readgzfile() can be used to read a file which is not in gzip format; in this case readgzfile() will directly read from the file without decompression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see previous comment
@driusan Just in case I retested it to make sure |
Brief summary of changes
nii.gz
files could not be opened with the brainbrowser module. This PR modifies the way we read the image so that if the file is gzipped, it is decompressed first before reading the content of the file.