@@ -35,7 +35,7 @@ def extract_subtomos(settings):
3535 pixel_size = it .rlnPixelSize
3636 if settings .use_deconv_tomo and "rlnDeconvTomoName" in md .getLabels () and os .path .isfile (it .rlnDeconvTomoName ):
3737 logging .info ("Extract from deconvolved tomogram {}" .format (it .rlnDeconvTomoName ))
38- with mrcfile .open (it .rlnDeconvTomoName ) as mrcData :
38+ with mrcfile .open (it .rlnDeconvTomoName , permissive = True ) as mrcData :
3939 orig_data = mrcData .data .astype (np .float32 )
4040 else :
4141 print ("Extract from origional tomogram {}" .format (it .rlnMicrographName ))
@@ -44,7 +44,7 @@ def extract_subtomos(settings):
4444
4545
4646 if "rlnMaskName" in md .getLabels () and it .rlnMaskName not in [None , "None" ]:
47- with mrcfile .open (it .rlnMaskName ) as m :
47+ with mrcfile .open (it .rlnMaskName , permissive = True ) as m :
4848 mask_data = m .data
4949 else :
5050 mask_data = None
@@ -89,7 +89,7 @@ def get_cubes_one(data_X, data_Y, settings, start = 0, mask = None, add_noise =
8989 path_noise = sorted ([settings .noise_dir + '/' + f for f in os .listdir (settings .noise_dir )])
9090 path_index = np .random .randint (len (path_noise ))
9191 def read_vol (f ):
92- with mrcfile .open (f ) as mf :
92+ with mrcfile .open (f , permissive = True ) as mf :
9393 res = mf .data
9494 return res
9595 noise_volume = read_vol (path_noise [path_index ])
@@ -119,11 +119,11 @@ def get_cubes(inp,settings):
119119 mrc , start = inp
120120 root_name = mrc .split ('/' )[- 1 ].split ('.' )[0 ]
121121 current_mrc = '{}/{}_iter{:0>2d}.mrc' .format (settings .result_dir ,root_name ,settings .iter_count - 1 )
122- with mrcfile .open (mrc ) as mrcData :
122+ with mrcfile .open (mrc , permissive = True ) as mrcData :
123123 iw_data = mrcData .data .astype (np .float32 )* - 1
124124 iw_data = normalize (iw_data , percentile = settings .normalize_percentile )
125125
126- with mrcfile .open (current_mrc ) as mrcData :
126+ with mrcfile .open (current_mrc , permissive = True ) as mrcData :
127127 ow_data = mrcData .data .astype (np .float32 )* - 1
128128 ow_data = normalize (ow_data , percentile = settings .normalize_percentile )
129129
@@ -212,7 +212,7 @@ def generate_first_iter_mrc(mrc,settings):
212212 '''
213213 root_name = mrc .split ('/' )[- 1 ].split ('.' )[0 ]
214214 extension = mrc .split ('/' )[- 1 ].split ('.' )[1 ]
215- with mrcfile .open (mrc ) as mrcData :
215+ with mrcfile .open (mrc , permissive = True ) as mrcData :
216216 orig_data = normalize (mrcData .data .astype (np .float32 )* - 1 , percentile = settings .normalize_percentile )
217217 orig_data = apply_wedge (orig_data , ld1 = 1 , ld2 = 0 )
218218 orig_data = normalize (orig_data , percentile = settings .normalize_percentile )
0 commit comments