-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmovingSlice.py
29 lines (23 loc) · 925 Bytes
/
movingSlice.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import argparse
from tqdm import tqdm
import numpy as np
import slice
def main():
parser = argparse.ArgumentParser()
parser.add_argument("path", help="relative path to the video file")
parser.add_argument("-o",
"--output",
type=str,
help="relative path to output directory",
required=False,
default="")
parser.add_argument("xc", help="x-coefficient", type=float)
parser.add_argument("yc", help="y-coefficient", type=float)
args = parser.parse_args()
videoPrism = slice.loadVideo(args.path)
for c in tqdm(np.linspace(0, 1, videoPrism.shape[0]),
desc="Slice Movement"):
img = slice.projectionSlice(videoPrism, args.xc, args.yc, c)
slice.saveImage(img, args.xc, args.yc, c, args.path, args.output)
if __name__ == "__main__":
main()