Hi Matthew,

I'll send you two header files of affected scans by private e-mail. I heard the 
tool is being upgraded to use nibabel v2.0, but we haven't been able to test if 
the problem is still present in the latest version.

Regards,
Jalmar

On Jun 11, 2015, at 06:47 PM, Matthew Brett <matthew.br...@gmail.com> wrote:

Hi,

On Thu, Jun 11, 2015 at 2:09 AM, Jalmar Teeuw <jal...@me.com> wrote:
Hi Matthew,

Thanks for getting back at this. We only process data for our users, so I don't 
have permission to share a sample with you. But I'll ask around to see if I can 
get a scan for you.

To be honest, we aren't quite sure if the problem is with nibabel (v1.3.0). I 
tried to reproduce the problem with one of the scan that was causing this 
problem, but the conversion worked fine for me (same data, same script, 
different platform). Although recently we had the same issue cropping up again 
for another user where only part of the data was affected by this problem. All 
we know is that the description field of the NIFTI header starts at the right 
offset, the magic number bytes are off by +one byte, and the brain looks 
skewed; hence the assumption of an extra byte in one of the transform fields.

Alternatively, we were wondering what happens if the content of the description 
field exceeded 80 characters

descr = "%s;%s;%s;%s" % (
pr_hdr.general_info['exam_name'],
pr_hdr.general_info['patient_name'],
pr_hdr.general_info['exam_date'].replace(' ',''),
pr_hdr.general_info['protocol_name'])
nhdr.structarr['descrip'] = descr[:80]

The python code neatly truncates the description to 80 characters. Could it be 
possible that an extra '\0' null byte gets written to terminate the string, 
causing the description field to be 81 bytes long?

I am fairly sure that there is no way to extend the structure by 1
byte with that command. The header is effectively a C structure,
wrapped by numpy, so even if numpy allowed you to overflow the field
length, it would still only overwrite the next field, and should not
extend the structure.

So - any help you can give to debug this would be great - I don't have
any good ideas at the moment... For example - can you send a header
from an affected file?

Cheers,

Matthew

_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

Reply via email to