Tutorials on layering, layer-smoothing, columnar anlysis here: https://layerfmri.com/category/code/
This is set of standalone layer-fMRI C++ programs that do not have any other dependencies.
Bob Cox and Rick Reynolds wrote few a nii I/O that I recommend. The original version is in the AFNI sources. I collected all the necessary files and adapted them for my taste. All the necessary files are:
nifti1_io.cpp nifti2.h nifti2_io.h nifti_tool.h nifticdf.h znzlib.h nifti1.h nifti1_io.h nifti2_io.cpp nifti_tool.cpp nifticdf.cpp znzlib.cpp
Using linking those allows you to use nii_datatype and load nii files in your own C++ program with the function
nifti_image * nim=NULL; nim = nifti_image_read(filename, 1);
It reads in a nii file, accesses the data, manipulates the individual voxels writes out the manipulated data as nii
Usage of My_nii_read.cpp 1.) download the all the files with from github E.g. with the command:
git clone https://github.com/layerfMRI/laynii
2.) go into subfolder:
3.) compile it with:
4.) execute it with:
./My_nii_read -input input_example.nii -output output.nii -cutoff 3
For more information see: https://layerfmri.com/2017/11/30/using-a-standalone-nii-i-o-in-c/
Comment on GSL
Parts of LAYNII depend on GSL.
It seems that GSL does not have the fit option automatically included. If there is an error when compiling about gsl/gsl_fit, consider installing the dev-package: sudo apt-get install libgsl0-dev
Update 180902: The fit include has been removed.