Repository navigation
BUG: Give i and j a defined value in nifti_mat44_to_orientation #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2778,7 +2778,7 @@ void nifti_dmat44_to_orientation( nifti_dmat44 R , | |
| case -2: i = NIFTI_A2P ; break ; | ||
| case 3: i = NIFTI_I2S ; break ; | ||
| case -3: i = NIFTI_S2I ; break ; | ||
| default: assert(0) ; break ; | ||
| default: assert(0) ; i = 0 ; break ; | ||
| } | ||
|
|
||
| switch( jbest*qbest ){ | ||
|
|
@@ -2788,7 +2788,7 @@ void nifti_dmat44_to_orientation( nifti_dmat44 R , | |
| case -2: j = NIFTI_A2P ; break ; | ||
| case 3: j = NIFTI_I2S ; break ; | ||
| case -3: j = NIFTI_S2I ; break ; | ||
| default: assert(0) ; break ; | ||
| default: assert(0) ; j = 0 ; break ; | ||
| } | ||
|
|
||
| switch( kbest*rbest ){ | ||
|
|
@@ -2798,7 +2798,7 @@ void nifti_dmat44_to_orientation( nifti_dmat44 R , | |
| case -2: k = NIFTI_A2P ; break ; | ||
| case 3: k = NIFTI_I2S ; break ; | ||
| case -3: k = NIFTI_S2I ; break ; | ||
| default: assert(0) ; break ; | ||
| default: assert(0) ; k = 0 ; break ; | ||
| } | ||
|
|
||
| *icod = i ; *jcod = j ; *kcod = k ; } | ||
|
|
@@ -2961,7 +2961,7 @@ void nifti_mat44_to_orientation( mat44 R , int *icod, int *jcod, int *kcod ) | |
| case -2: i = NIFTI_A2P ; break ; | ||
| case 3: i = NIFTI_I2S ; break ; | ||
| case -3: i = NIFTI_S2I ; break ; | ||
| default: break; | ||
| default: i = 0 ; break; | ||
| } | ||
|
|
||
| switch( jbest*qbest ){ | ||
|
|
@@ -2971,7 +2971,7 @@ void nifti_mat44_to_orientation( mat44 R , int *icod, int *jcod, int *kcod ) | |
| case -2: j = NIFTI_A2P ; break ; | ||
| case 3: j = NIFTI_I2S ; break ; | ||
| case -3: j = NIFTI_S2I ; break ; | ||
| default: break; | ||
| default: j = 0 ; break; | ||
| } | ||
|
|
||
| switch( kbest*rbest ){ | ||
|
|
@@ -2981,7 +2981,7 @@ void nifti_mat44_to_orientation( mat44 R , int *icod, int *jcod, int *kcod ) | |
| case -2: k = NIFTI_A2P ; break ; | ||
| case 3: k = NIFTI_I2S ; break ; | ||
| case -3: k = NIFTI_S2I ; break ; | ||
| default: break; | ||
| default: k = 0 ; break; | ||
| } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please also add All three of these groups of 3 have comment above saying: "At this point ibest is 1 or 2 or 3; pbest is -1 or +1; etc." Assuming that's true, the assert is desirable to prove the comment. And the assignment to 0 is good in case the comment/assert are wrong. |
||
|
|
||
| *icod = i ; *jcod = j ; *kcod = k ; } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Google Carbon] Missing
assert(0) ;here (and on lines 2974 and 2984 below forjandk). Please change all threedefault:arms innifti_mat44_to_orientationtodefault: assert(0) ; i = 0 ; break ;(etc.) so they matchnifti_dmat44_to_orientationabove (lines 2781, 2791, 2801) andniftilib/nifti1_io.c(lines 2112, 2122, 2132).