a | b/code/exam.py | ||
---|---|---|---|
1 | """ |
||
2 | Remove some wrong file |
||
3 | """ |
||
4 | |||
5 | import SimpleITK as sitk |
||
6 | import numpy as np |
||
7 | import csv |
||
8 | from glob import glob |
||
9 | import pandas as pd |
||
10 | import os |
||
11 | import matplotlib |
||
12 | import matplotlib.pyplot as plt |
||
13 | import traceback |
||
14 | import random |
||
15 | from PIL import Image |
||
16 | |||
17 | path = '/home/ubuntu/data/train-3d/' |
||
18 | |||
19 | file_list=glob(path+"*.npy") |
||
20 | |||
21 | for file in file_list: |
||
22 | data = np.load(file) |
||
23 | print(data.shape) |
||
24 | if data.shape != (26,40,40): |
||
25 | os.remove(file) |