반응형 Python7 error: OpenCV(4.5.3) :-1: error: (-5:Bad argument) in function 'circle' - img = array_patient[:,:, img_shape[2]//2] 인 상태에서 사용했을 경우에 이러한 오류가 난다. error: OpenCV(4.5.3) :-1: error: (-5:Bad argument) in function 'circle' > Overload resolution failed: > - Layout of the output array img is incompatible with cv::Mat (step[ndims-1] != elemsize or step[1] != elemsize*nchannels) > - Expected Ptr for argument 'img' - img2 = array_patient[:,:, img_shape[2]//2].copy() .copy()를 사용.. 2022. 3. 2. DICOM preprocessing [python code] # # Loop over the image files and store everything into a list. # def load_scan(path): slices = [dicom.read_file(path + '/' + s) for s in os.listdir(path)] slices.sort(key = lambda x: int(x.InstanceNumber)) try: slice_thickness = np.abs(slices[0].ImagePositionPatient[2] - slices[1].ImagePositionPatient[2]) except: slice_thickness = np.abs(slices[0].SliceLocation - slices[1].SliceLo.. 2022. 2. 14. python plot image pop up import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline 팝업으로 그림을 보고 싶으면 qt를 하시구요 When you want to have plot popout, just do this: %matplotlib qt 쥬피터 노트북 내에서 보려면 inline을 쓰시면 됩니다. You can switch back to inline mode again by doing: %matplotlib inline 2021. 1. 20. 이전 1 2 다음 728x90 반응형