Skip to content

Commit

Permalink
TST+CLN: More slice ordering testing, minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
moloney authored and effigies committed Jul 25, 2024
1 parent b6de200 commit 0dce56c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nibabel/nicom/tests/test_dicomwrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def fake_frames(seq_name, field_name, value_seq, frame_seq=None):
class Fake:
pass

if frame_seq == None:
if frame_seq is None:
frame_seq = [Fake() for _ in range(len(value_seq))]
for value, fake_frame in zip(value_seq, frame_seq):
fake_element = Fake()
Expand Down Expand Up @@ -868,6 +868,11 @@ def test_data_fake(self):
sorted_data = data[..., [3, 1, 2, 0]]
fake_mf['pixel_array'] = np.rollaxis(sorted_data, 2)
assert_array_equal(MFW(fake_mf).get_data(), data * 2.0 - 1)
# Check slice sorting with negative index / IPP correlation
fake_mf.update(fake_shape_dependents(dim_idxs, sid_dim=0, flip_ipp_idx_corr=True))
sorted_data = data[..., [0, 2, 1, 3]]
fake_mf['pixel_array'] = np.rollaxis(sorted_data, 2)
assert_array_equal(MFW(fake_mf).get_data(), data * 2.0 - 1)
# 5D!
dim_idxs = [
[1, 4, 2, 1],
Expand Down

0 comments on commit 0dce56c

Please sign in to comment.