bbrister / SIFT3D

Analogue of the scale-invariant feature transform (SIFT) for three-dimensional images. Includes an image processing and linear algebra library with feature matching and RANSAC regression. Also includes IO functions supporting a variety of image formats.
MIT License
134 stars 47 forks source link

Altered Image structure fields #2

Closed mnburkle closed 9 years ago

mnburkle commented 9 years ago

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

bbrister commented 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)

bbrister commented 9 years ago

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!

mnburkle commented 9 years ago

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)