Dear Marko,
If I understand you correctly, you want to use spm_reslice with data in
memory? If so, it is not as straightforward as a single function call
but you can use spm_bsplinc/spm_bsplins. This is what is done, for
example, when reslicing an explicit mask in the GLM estimation:
https://github.com/spm/spm12/blob/master/spm_spm.m#L542
Best regards,
Guillaume.
On 07/12/2020 15:48, Apl.Prof. Dr. Marko Wilke wrote:
> Dear All,
>
> I am playing around with automatically applying several different
> orientations to an image by modifying (in this example) pitch. To this
> effect, I do something like
>
> M = spm_matrix([0 0 0 curr_pitch]); % set new pitch
> MM = spm_get_space(curr_img); % get current
> image orientation
> spm_get_space(curr_img, M*MM); % apply new image
> orientation
>
> with curr_img being the filename of the image under question. However,
> in order to work with the thus-tilted volume, I then apply this by
> writing out the resliced version of this image and then read it back
> from disk, which works but seems really unnecessary. Is there a way to
> apply such a transformation to the memory mapped volume instead?
>
> Cheers
> Marko
>
> PS: I realize this is a rhetorical question as there certainly is but I
> tried for some time so any pointers are appreciated.
>
> --
> ____________________________________________________
> Prof. Dr. med. Marko Wilke
> Facharzt für Kinder- & Jugendmedizin, Neuropädiater
> Leiter, Experimentelle Pädiatrische Neurobildgebung
> Geschäftsführender Oberarzt der Abt. Neuropädiatrie
> Universitäts-Kinderklinik
>
> Marko Wilke, MD, PhD
> Pediatrician and Pediatric Neurologist
> Head, Experimental Pediatric Neuroimaging
> Senior Consultant in Pediatric Neurology
> University Children's Hospital
>
> Hoppe-Seyler-Str. 1
> D - 72076 Tübingen, Germany
> Tel. +49 7071 29-83416
> Fax +49 7071 29-5473
> [log in to unmask]
>
> http://www.medizin.uni-tuebingen.de/kinder/epn/
> ____________________________________________________
>
--
Guillaume Flandin, PhD
Wellcome Centre for Human Neuroimaging
UCL Queen Square Institute of Neurology
London WC1N 3BG
|