<div dir="ltr">Regarding archiving the mailing list, it'd actually be really easy to use this:<div><br></div><div><a href="https://www.mail-archive.com/faq.html#newlist">https://www.mail-archive.com/faq.html#newlist</a><br></div><div><br></div><div>I am almost certain that your proposed solution will work. I suppose this means the documentation could be improved, but I'm not sure how to address it. Maybe having a list with all functions and their short description on one page?</div><div><br></div><div>I'll report back if there's a problem anyway. Otherwise, assume your solution worked.</div><div><br></div><div>Thanks for your quick response!</div><div>D</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 24, 2017 at 5:10 PM, Matthew Brett <span dir="ltr"><<a href="mailto:matthew.brett@gmail.com" target="_blank">matthew.brett@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<span class=""><br>
On Fri, Mar 24, 2017 at 8:57 PM, Dav Clark <<a href="mailto:davclark@gmail.com">davclark@gmail.com</a>> wrote:<br>
> So, this is a post on stack overflow:<br>
><br>
> <a href="http://stackoverflow.com/questions/33737282/copy-header-when-merging-multiple-mri-images-using-nibabel" rel="noreferrer" target="_blank">http://stackoverflow.com/<wbr>questions/33737282/copy-<wbr>header-when-merging-multiple-<wbr>mri-images-using-nibabel</a><br>
><br>
> I'm doing something more or less equivalent:<br>
><br>
> ```<br>
> sample_path = 'some_path/some_sub*.hdr'<br>
> fnames = glob(sample_path)<br>
> imgs = [nib.load(fn) for fn in fnames]<br>
><br>
> img_data = np.stack([img.dataobj for img in imgs], axis=-1)<br>
><br>
> converted = nib.Nifti1Image(img_data, imgs[0].affine, imgs[0].header)<br>
> converted.to_filename('some_<wbr>filename.nii.gz')<br>
> ```<br>
><br>
> But the output ends up having a severely restricted range (thus<br>
> rendering by default as black in fslview) as compared to fslmerge -t.<br>
> fslmerge gets the TR right, and the nibabel version sets TR (pixdim4)<br>
> to 1.0. Moreover imgs[0].header.get_slice_<wbr>times() results in an error.<br>
><br>
> Also, while the dimensions appear to be the same, I get different<br>
> shaped time-series (as well as different absolute values, of course)<br>
> from the two different conversion paths. I suspect I'm missing a<br>
> scaling parameter from the files.<br>
><br>
> For now, I am just using fslmerge -t, but since at least some other<br>
> person out there has also done this (see so question linked above), I<br>
> figure it's worth asking.<br>
><br>
> If I could get this to work, it becomes very easy to implement in dask<br>
> and take advantage of the spiffy computer I now have access to...<br>
<br>
</span>Did you try:<br>
<br>
converted = nib.concat_images(fnames)<br>
<br>
? I guess the correct TR and slice timing info is correctly set in the<br>
first image header - I mean:<br>
<br>
first_header = nib.load(fnames[0]).header<br>
<span class=""><br>
> ps - is there a searchable archive of the list? If not, I have a buddy<br>
> who is pretty facile with mailman listservs...<br>
<br>
</span>Actually, no, I don't think we have - would be very glad of help.<br>
We're using the same <a href="http://python.org" rel="noreferrer" target="_blank">python.org</a> mailman hosting as scipy and numpy, so<br>
a general solution would be generally useful.<br>
<br>
Cheers,<br>
<br>
Matthew<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>
</blockquote></div><br></div>