devel > BrainVisa GIFTI files
Showing 1-5 of 5 posts
Apr 15, 2008 07:04 PM | Richard Reynolds
BrainVisa GIFTI files
Hi All,
In the base64 encoding, is it okay to have newlines in the binary data? The BrainVisa files have them, which makes the datasets look nicer. But I didn't know this was a valid base64 encoding, and so my library whines about it.
Note that the datasets are still read properly, aside from the whining...
Should those characters be skipped automatically?
Either way is fine with me, it does make the files easier to view in an editor.
- rick
In the base64 encoding, is it okay to have newlines in the binary data? The BrainVisa files have them, which makes the datasets look nicer. But I didn't know this was a valid base64 encoding, and so my library whines about it.
Note that the datasets are still read properly, aside from the whining...
Should those characters be skipped automatically?
Either way is fine with me, it does make the files easier to view in an editor.
- rick
Apr 16, 2008 10:04 AM | Olivier Coulon
RE: BrainVisa GIFTI files
rick,
I have to look into it but those newlines are not meant to be. The python code that generates the binary array looks like this :
for i in xrange(texture.size()):
val=texture.item(i)
valeur = valeur + pack(fmt, val)
valeur64=base64.encodestring(valeur)
So no sign of new lines... it seem to be systematically inserted added after each chunk of 76 characters.
I'll come back to you about this once I have understood why it is there.
Olivier
I have to look into it but those newlines are not meant to be. The python code that generates the binary array looks like this :
for i in xrange(texture.size()):
val=texture.item(i)
valeur = valeur + pack(fmt, val)
valeur64=base64.encodestring(valeur)
So no sign of new lines... it seem to be systematically inserted added after each chunk of 76 characters.
I'll come back to you about this once I have understood why it is there.
Olivier
Apr 17, 2008 01:04 PM | John Harwell - Washington University School of Medicine
RE: BrainVisa GIFTI files
Olivier,
It appears that the base64 encoder you are using is encoding the data
for use with email (MIME - Multipurpose Internet Mail Extensions).
See section 2.1 of http://www.ietf.org/rfc/rfc3548.txt or the section
titled MIME in http://en.wikipedia.org/wiki/Base64.
John
>
>>
>> By: Olivier Coulon
>>
>> rick,
>> I have to look into it but those newlines are not meant to be. The
>> python code
>> that generates the binary array looks like this :
>>
>> for i in xrange(texture.size()):
>> val=texture.item(i)
>> valeur = valeur + pack(fmt, val)
>> valeur64=base64.encodestring(valeur)
>>
>> So no sign of new lines... it seem to be systematically inserted
>> added after
>> each chunk of 76 characters.
>> I'll come back to you about this once I have understood why it is
>> there.
>>
>> Olivier
>>
It appears that the base64 encoder you are using is encoding the data
for use with email (MIME - Multipurpose Internet Mail Extensions).
See section 2.1 of http://www.ietf.org/rfc/rfc3548.txt or the section
titled MIME in http://en.wikipedia.org/wiki/Base64.
John
>
>>
>> By: Olivier Coulon
>>
>> rick,
>> I have to look into it but those newlines are not meant to be. The
>> python code
>> that generates the binary array looks like this :
>>
>> for i in xrange(texture.size()):
>> val=texture.item(i)
>> valeur = valeur + pack(fmt, val)
>> valeur64=base64.encodestring(valeur)
>>
>> So no sign of new lines... it seem to be systematically inserted
>> added after
>> each chunk of 76 characters.
>> I'll come back to you about this once I have understood why it is
>> there.
>>
>> Olivier
>>
Apr 21, 2008 09:04 AM | Olivier Coulon
RE: BrainVisa GIFTI files
Thank you for this information John. Silly me. I now use another
encoding algorithm and it seems to be OK now. I will upload a new
version of the files later on today.
Olivier
Olivier
Apr 21, 2008 01:04 PM | Olivier Coulon
RE: BrainVisa GIFTI files
Dear all,
a new version of the brainvisa-generated gifti files has been uploaded on the site. The base 64 encoding has been changed and they have been checked with gifti_tools. Let me know if you encounter any problem reading them.
Olivier
a new version of the brainvisa-generated gifti files has been uploaded on the site. The base 64 encoding has been changed and they have been checked with gifti_tools. Let me know if you encounter any problem reading them.
Olivier
