Closed mnburkle closed 9 years ago
This is good, except for 3 changes:
-When finding the dimensionality (read_nii), iterate from 0 to nifti->ndims, just in case the rest aren't initialized -Remove the unused "dim" variable in read_nii -Initialize ux, uy, and uz to defaults in init_im, not init_im_first_time (the latter is a shortcut that calls the former--init_im is the one that is actually necessary. I realize that the name of init_im_first_time is confusing)
Good. One issue--the dimension has to exactly match 3. With your code, a 1-D or 2-D image would be accepted. (Eventually I would like to support 2D, but for now this is not supported.)
Also a few points about style:
-Please declare variables at the top of their scope, to match the style of the rest of the function. (This is a contentious point--it used to be required in C and was lifted in 1989, but I think it helps the readability of the code.) So line 1002 would have "int x, y, z, dim_counter, last_revelant_index;" -Please convert tabs to spaces, to match the indentation of the rest of the code
Thanks!
Fixed all the issues except for converting tabs to spaces - I'm not sure which lines have tabs/spaces, or if theres some sort of setting on sublime that might fix all that (Edit: Just kidding I think I figured it out, let me know if that worked I just found the setting in Sublime to convert tabs to spaces)
Finds image dimensions by iterating through the dim[8] array in the nii image and ignoring trailing 1's Saves grid spacing in image structure fields 'ux', 'uy', and 'uz' for later use in interpolation