<div dir="ltr"><div>Works great! Thanks!<br><br></div><div>Valerie<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 22, 2017 at 2:51 PM, Christopher Markiewicz <span dir="ltr"><<a href="mailto:effigies@bu.edu" target="_blank">effigies@bu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Valerie,</div><div><br></div>Assuming that it's not gzipped, you can do something like:<div><br></div><div>    from io import BytesIO</div><div>    from nibabel import FileHolder, Nifti1Image</div><div>    fh = FileHolder(fileobj=BytesIO(<wbr>input_stream))</div><div>    img = Nifti1Image.from_filemap({'<wbr>header': fh, 'image': fh})</div><div><br></div><div>If it is gzipped, adjust accordingly:</div><div><br></div><div>    from gzip import GzipFile</div><div>    fh = FileHolder(fileobj=GzipFile(<wbr>fileobj=BytesIO(input_stream))<wbr>)</div><div><br></div><div>Cheers,</div><div>Chris</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, Feb 22, 2017 at 2:22 PM, val hs <span dir="ltr"><<a href="mailto:valeriehayot@gmail.com" target="_blank">valeriehayot@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div><div>Hi,<br><br></div>I am trying to process nifti-1 images using HDFS and I was wondering if it was possible to read an image's byte stream into nibabel as I want to avoid saving the image locally. <br><br></div>Thanks,<br><br></div>Valerie <br></div>
<br></div></div>______________________________<wbr>_________________<br>
Neuroimaging mailing list<br>
<a href="mailto:Neuroimaging@python.org" target="_blank">Neuroimaging@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/neuroimaging" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/neuroimaging</a><br>
<br></blockquote></div><br></div></div>
<br>______________________________<wbr>_________________<br>
Neuroimaging mailing list<br>
<a href="mailto:Neuroimaging@python.org">Neuroimaging@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/neuroimaging" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/neuroimaging</a><br>
<br></blockquote></div><br></div>