Main content

Home

Menu

Loading wiki pages...

View
Wiki Version:
**Native Matlab NIfTI support for SamSrf** When using Matlab's native NIfTI reading functions (R2017b & later) but you do not have SPM installed, you can use this mini-toolbox instead. It overrides several SPM scripts with functions of the same name. This is not the most elegant solution but avoids messing with SamSrf's core functionality & screwing up people's projects in the process. In theory, if you were so inclined, you could also use these functions as a template for implementing other NIfTI reading tools, such as Larsson's cbi toolbox etc, but you will need to figure this out on your own. **DO NOT USE THIS TOOLBOX ALONGSIDE SPM!!! It's also very unwise to mix SPM's and Matlab's NIfTI tools, so don't do that...** Essentially, SamSrf needs NIfTI header structures containing: - hdr.fname: File name with .nii extension - hdr.dim: Image dimensions as 1x3 vector for 3D image & 1x4 for 4D time series image - hdr.dt: Data type as 1x2 vector but you can just set this to [16 0]. Only needed for writing NII files. - hdr.mat: Affine transformation matrix This should be in SPM's format meaning that *hdr.mat = [mat(:,1:3) mat(:,end)-sum(mat(:,1:3),2)];* where mat is the transformation matrix you read directly from the header. (In the native Matlab tools this matrix must first be transposed, so double check how this looks in whatever tool you're writing this for)
OSF does not support the use of Internet Explorer. For optimal performance, please switch to another browser.
Accept
This website relies on cookies to help provide a better user experience. By clicking Accept or continuing to use the site, you agree. For more information, see our Privacy Policy and information on cookie use.
Accept
×

Start managing your projects on the OSF today.

Free and easy to use, the Open Science Framework supports the entire research lifecycle: planning, execution, reporting, archiving, and discovery.