Skip to content

Commit 7bbff01

Browse files
add new flip functions
1 parent eb3deff commit 7bbff01

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

flipAll2.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import os
2+
import numpy as np
3+
import matplotlib.pyplot as plt
4+
import cv2 as cv
5+
6+
def testslice(array):
7+
8+
plt.imshow(array[:, 100, :], cmap = 'gray')
9+
plt.show()
10+
11+
def flip_ct(array):
12+
13+
flipped = np.rot90(array, k = 2, axes = (2, 0))
14+
return flipped
15+
16+
def flip_xr(array):
17+
18+
flipped = np.rot90(array, k = 2)
19+
return flipped

resampling.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ def load_scan(path):
1919

2020
newdirs.append(s)
2121

22-
23-
2422
slices = [dicom.read_file(path + '/' + s) for s in newdirs]
2523
slices.sort(key = lambda x: float(x.ImagePositionPatient[2]))
2624
try:

0 commit comments

Comments
 (0)