@@ -1056,6 +1056,7 @@ def get_sorted_slice_indices(self):
1056
1056
dynamics = self .image_defs ['dynamic scan number' ]
1057
1057
phases = self .image_defs ['cardiac phase number' ]
1058
1058
echos = self .image_defs ['echo number' ]
1059
+ image_type = self .image_defs ['image_type_mr' ]
1059
1060
1060
1061
# try adding keys only present in a subset of .PAR files
1061
1062
idefs = self .image_defs
@@ -1076,7 +1077,7 @@ def get_sorted_slice_indices(self):
1076
1077
1077
1078
# Define the desired sort order (last key is highest precedence)
1078
1079
keys = (slice_nos , echos , phases ) + \
1079
- diffusion_keys + asl_keys + (dynamics , )
1080
+ diffusion_keys + asl_keys + (dynamics , image_type )
1080
1081
1081
1082
"""
1082
1083
Data sorting is done in two stages:
@@ -1098,8 +1099,8 @@ def get_sorted_slice_indices(self):
1098
1099
vol_nos = np .asarray (vol_nos )[unsort_indices ]
1099
1100
1100
1101
# final set of sort keys
1101
- keys += (vol_nos , np .logical_not (is_full ), )
1102
- sort_order = np .lexsort (keys )
1102
+ keys += (vol_nos , np .logical_not (is_full )) # highest priority
1103
+ sort_order = np .lexsort (tuple ( keys ) )
1103
1104
1104
1105
# Figure out how many we need to remove from the end, and trim them.
1105
1106
# Based on our sorting, they should always be last.
0 commit comments