Rank: 79 based on 774 downloads (last 30 days) and 5 files submitted
photo

Jimmy Shen

E-mail

Personal Profile:

 

Watch this Author's files

 

Files Posted by Jimmy Shen View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
22 Jan 2014 Screenshot Tools for NIfTI and ANALYZE image Load, save, make, reslice, view (and edit) both NIfTI and ANALYZE data on any platform Author: Jimmy Shen medical, reslice, isotropic, image, header, niftl 612 134
  • 4.65957
4.7 | 51 ratings
04 Dec 2012 geotiffwrite Write a 2D or 3D array to a single or multi-band GeoTIFF file Author: Jimmy Shen geotiff format write ..., earth, science, geotiff, format, write 50 27
  • 4.9
4.9 | 10 ratings
22 Feb 2011 Load BIOPAC ACQ (AcqKnowledge for PC) data Load BIOPAC's *.acq file (AcqKnowledge for Windows data format). Author: Jimmy Shen medical, biopac acqknowledge, acq, eeg, file, data 51 16
  • 4.625
4.6 | 8 ratings
16 Apr 2009 Screenshot Resampling volume or image with affine matrix Use affine matrix to convert 3D vol or 2D img to orthogonal one with corresponding affine matrix. Author: Jimmy Shen geometric transformat..., image registration, 3d, image, volume, voxel 31 14
  • 4.57143
4.6 | 7 ratings
22 Aug 2008 Screenshot 3D Bresenham's line generation Generate X Y Z coordinates of a 3D Bresenham's line between two given points Author: Jimmy Shen specialized, plotting, 3d, bresenham algorithm, raster, line 30 1
  • 4.0
4.0 | 1 rating
Comments and Ratings by Jimmy Shen View all
Updated File Comments Rating
14 Feb 2014 Tools for NIfTI and ANALYZE image Load, save, make, reslice, view (and edit) both NIfTI and ANALYZE data on any platform Author: Jimmy Shen

you can't do it. check faq.pdf when you need load_untouch_nii or load_nii

12 Feb 2014 Tools for NIfTI and ANALYZE image Load, save, make, reslice, view (and edit) both NIfTI and ANALYZE data on any platform Author: Jimmy Shen

because it's not the business of view_nii to interpret and apply header info.

31 Dec 2013 Tools for NIfTI and ANALYZE image Load, save, make, reslice, view (and edit) both NIfTI and ANALYZE data on any platform Author: Jimmy Shen

Nicolas, please tell me what is the exact "clues" or "messages" that confuse you. In addition, please tell me what you try to do.

19 Nov 2013 Tools for NIfTI and ANALYZE image Load, save, make, reslice, view (and edit) both NIfTI and ANALYZE data on any platform Author: Jimmy Shen

You can use "load_untouch_nii / save_untouch_nii" pair. Here's an example:

nii = load_untouch_nii('avg152T1_LR_nifti.nii');
nii.hdr.hist.descrip = 'Mengye';
save_untouch_nii(nii, 'new_avg152T1_LR_nifti.nii');

Unless you touch nii.img by yourself, e.g. nii.img(1)=0, it will not be changed, although it is also loaded and saved. Only the header (nii.hdr) is edited in the way you make the change.

In addition, if the input file is in Analyze 7.5 format, the output will be kept in Analyze 7.5 format. If the input is in NIfTI format, the output will be kept in NIfTI format.

That is why I have "load_untouch_" as well as "load_" feature. However, in most case, you want to use "load_" feature, since you don't want to interpret affine matrix in the header, and make all sorts of flipping and rotation by yourself, do you?

11 Nov 2013 Resampling volume or image with affine matrix Use affine matrix to convert 3D vol or 2D img to orthogonal one with corresponding affine matrix. Author: Jimmy Shen

The output volume is determined by the original volume, the affine matrix, and the new voxel_size that you choose. If any of the above inputs change, the output will also change. Otherwise, the output should be consistent.

The difference in dimension between output volume and original one is obvious. Just think about a unit square in 2D plane with dimension of [1 1]. If you rotate it 45 degree, you have to use a dimension of [1.414 1.414] to hold the same square. However, the distance from origin to edges are still 1.

In order to properly crop the transformed volume, you need to keep in mind that we are focusing on the unit of distance from the originator based on the affine matrix (e.g. millimeter), and don't worry about voxel size or its dimension. Since I have not used it for registration, I don't have detail procedure for you.

Comments and Ratings on Jimmy Shen's Files View all
Updated File Comment by Comments Rating
29 Nov 2014 Tools for NIfTI and ANALYZE image Load, save, make, reslice, view (and edit) both NIfTI and ANALYZE data on any platform Author: Jimmy Shen M

Hi,
So I was checking your tool, very helpful in viewing .nii.gz file from matlab, but how can I use it to save my file as a .mat file with the same size (256*256*50).

Thanks,
Mayada

18 Nov 2014 Tools for NIfTI and ANALYZE image Load, save, make, reslice, view (and edit) both NIfTI and ANALYZE data on any platform Author: Jimmy Shen Janki Mehta

Hi,

Thanks for the toolbox. I have following issue:
I have a 3D matrix in MATLAB which I need to convert to NIfTI or ANALYZE format so as to view it in SPM8. For this I am using "Tools for NIfTI and ANALYZE image". My problem is once I convert this 3D matrix to ANALYZE format using make_ana command, I get the brain volume that is rotated/flipped w.r.t the original volume.
How can I resolve this?
NOTE: co-registering this to original brain volume did not help, the result was still flipped.

Thanks,

Janki

04 Nov 2014 Tools for NIfTI and ANALYZE image Load, save, make, reslice, view (and edit) both NIfTI and ANALYZE data on any platform Author: Jimmy Shen Meytal

Thank you so much for this very helpful code!

I encountered a problem with loading some of my files.
I prepared a mask file in FSL, and want to load it into matlab together with some functional files.
The problem is the affine matrix has non-orthogonal rotation for 2 of my subjects, so I cannot use "load_nii".
I am not sure if I can use "reslice_nii" because I still need this mask file to have the same dimensions as my functional file.
Any ideas would be much appreciated!
Thanks,
Meytal

30 Sep 2014 Load BIOPAC ACQ (AcqKnowledge for PC) data Load BIOPAC's *.acq file (AcqKnowledge for Windows data format). Author: Jimmy Shen Sanjeev

I am trying to load a dataset recorded by Biopac Version 4.3 , when i am trying to load that data using acq=load_acq('data.acq_'); it shows following error
Loading data.acq_ Subscript indices must either be real positive integers or logicals.

Error in load_acq>read_acq (line 470)
mask(1:sample_divider(j):min_len, j)=1;

Error in load_acq (line 96)
acq.data = read_acq(fid, acq.hdr, chan_by_chan);

Please suggest how to resolve this

23 Sep 2014 Tools for NIfTI and ANALYZE image Load, save, make, reslice, view (and edit) both NIfTI and ANALYZE data on any platform Author: Jimmy Shen kb

Contact us