From d0187166d8e9229552d0836b96ede9e6b9e8982f Mon Sep 17 00:00:00 2001 From: bf777 Date: Tue, 22 Oct 2024 12:05:59 -0700 Subject: [PATCH 1/2] 1.21: Cleaned up and refactored code; added transformation matrices output (#43) --- mesonet/atlas_brain_matching.py | 143 ++++++++++++++++++++------------ mesonet/data.py | 1 - mesonet/dlc_predict.py | 1 + mesonet/gui_test.py | 13 +++ mesonet/gui_train.py | 17 ++-- mesonet/img_augment.py | 16 ++-- mesonet/mask_functions.py | 50 ++--------- mesonet/utils.py | 1 - setup.py | 2 +- 9 files changed, 130 insertions(+), 114 deletions(-) diff --git a/mesonet/atlas_brain_matching.py b/mesonet/atlas_brain_matching.py index aadd301..1495536 100755 --- a/mesonet/atlas_brain_matching.py +++ b/mesonet/atlas_brain_matching.py @@ -13,7 +13,7 @@ import cv2 import imutils import math -import scipy.io +from scipy.io import savemat, loadmat import skimage.io as io from skimage.transform import PiecewiseAffineTransform, warp import imageio @@ -33,7 +33,7 @@ def find_peaks(img): img = cv2.imread(str(img), 0) im = img.copy() x_min = int(np.around(im.shape[0] / 2)) - im1 = im[:, x_min : im.shape[0]] + im1 = im[:, x_min: im.shape[0]] im2 = im[:, 0:x_min] (minVal, max_val, minLoc, max_loc) = cv2.minMaxLoc(im1) (minVal2, maxVal2, minLoc2, maxLoc2) = cv2.minMaxLoc(im2) @@ -47,7 +47,7 @@ def find_peaks(img): def coords_to_mat( - sub_dlc_pts, i, output_mask_path, bregma_present, bregma_index, landmark_arr + sub_dlc_pts, i, output_mask_path, bregma_present, bregma_index, landmark_arr ): if bregma_present: x_bregma, y_bregma = sub_dlc_pts[bregma_index] @@ -58,7 +58,7 @@ def coords_to_mat( pt_adj_to_mat = np.array(pt_adj, dtype=object) if not os.path.isdir(os.path.join(output_mask_path, "mat_coords")): os.mkdir(os.path.join(output_mask_path, "mat_coords")) - scipy.io.savemat( + savemat( os.path.join( output_mask_path, "mat_coords/landmarks_{}_{}.mat".format(i, landmark), @@ -78,7 +78,7 @@ def sensory_to_mat(sub_dlc_pts, bregma_pt, i, output_mask_path): pt_adj_to_mat = np.array(pt_adj, dtype=object) if not os.path.isdir(os.path.join(output_mask_path, "mat_coords")): os.mkdir(os.path.join(output_mask_path, "mat_coords")) - scipy.io.savemat( + savemat( os.path.join( output_mask_path, "mat_coords/sensory_peaks_{}_{}.mat".format(i, landmark), @@ -98,7 +98,7 @@ def atlas_from_mat(input_file, mat_cnt_list): file = input_file atlas_base = np.zeros((512, 512), dtype="uint8") if glob.glob(os.path.join(input_file, "*.mat")): - mat = scipy.io.loadmat(file) + mat = loadmat(file) mat_shape = mat[list(mat.keys())[3]] if len(mat_shape.shape) > 2: for val in range(0, mat_shape.shape[2]): @@ -136,6 +136,7 @@ def atlas_from_mat(input_file, mat_cnt_list): def atlas_rotate(dlc_pts, im): + # Check if DeepLabCut coordinates are within reasonable bounds, otherwise moves them out of bounds to not be used dlc_y_pts = [ coord if (190 <= coord[0] <= 330) else (1000, 1000) for coord in dlc_pts ] @@ -147,10 +148,11 @@ def atlas_rotate(dlc_pts, im): im_rotate_mat = cv2.getRotationMatrix2D( (im.shape[1] / 2, im.shape[0] / 2), rotate_deg, 1.0 ) + im_rotated = cv2.warpAffine(im, im_rotate_mat, (512, 512)) x_min = int(np.around(im_rotated.shape[0] / 2)) im_left = im_rotated[:, 0:x_min] - im_right = im_rotated[:, x_min : im_rotated.shape[0]] + im_right = im_rotated[:, x_min: im_rotated.shape[0]] return im_left, im_right @@ -189,29 +191,29 @@ def getMaskContour(mask_dir, atlas_img, predicted_pts, actual_pts, cwd, n, main_ def atlasBrainMatch( - brain_img_dir, - sensory_img_dir, - coords_input, - sensory_match, - mat_save, - threshold, - git_repo_base, - region_labels, - landmark_arr_orig, - use_unet, - use_dlc, - atlas_to_brain_align, - model, - olfactory_check, - plot_landmarks, - align_once, - original_label, - use_voxelmorph, - exist_transform, - voxelmorph_model="motif_model_atlas.h5", - vxm_template_path="templates", - dlc_template_path="dlc_templates", - flow_path="", + brain_img_dir, + sensory_img_dir, + coords_input, + sensory_match, + mat_save, + threshold, + git_repo_base, + region_labels, + landmark_arr_orig, + use_unet, + use_dlc, + atlas_to_brain_align, + model, + olfactory_check, + plot_landmarks, + align_once, + original_label, + use_voxelmorph, + exist_transform, + voxelmorph_model="motif_model_atlas.h5", + vxm_template_path="templates", + dlc_template_path="dlc_templates", + flow_path="", ): """ Align and overlap brain atlas onto brain image based on four landmark locations in the brain image and the atlas. @@ -248,7 +250,7 @@ def atlasBrainMatch( a new transformation. :param voxelmorph_model: the name of a .h5 model located in the models folder of the git repository for MesoNet, generated using voxelmorph and containing weights for a voxelmorph local deformation model. - :param vxm_template_path: the path to a template atlas (.npy or .mat( to which the brain image will be aligned in + :param vxm_template_path: the path to a template atlas (.npy or .mat) to which the brain image will be aligned in voxelmorph. :param flow_path: the path to a voxelmorph transformation field that will be used to transform all data instead of predicting a new transformation if exist_transform is True. @@ -304,7 +306,6 @@ def atlasBrainMatch( im_left = np.uint8(im_left) im_right = np.uint8(im_right) im = np.uint8(im) - # im = atlas_from_mat(os.path.join(git_repo_base, 'atlases/atlas_ROIs.mat')) atlas = im # FOR ALIGNING BRAIN TO ATLAS for num, file in enumerate(os.listdir(cwd)): @@ -318,7 +319,6 @@ def atlasBrainMatch( tif_stack = imageio.mimread(os.path.join(brain_img_dir, file)) for tif_im in tif_stack: brain_img_arr.append(tif_im) - # i_coord, j_coord = np.array([(100, 256, 413, 256), (148, 254, 148, 446)]) # https://www.pyimagesearch.com/2014/07/21/detecting-circles-images-using-opencv-hough-circles/ coord_circles_img = cv2.imread( @@ -345,6 +345,7 @@ def atlasBrainMatch( ] ) + # Coordinates of all atlas coordinates, assuming 512x512 image size atlas_arr = np.array( [ (102, 148), @@ -362,6 +363,7 @@ def atlasBrainMatch( peak_arr_flat = [] peak_arr_total = [] + # If matching to peaks of sensory activation method is being used if sensory_match: for num, file in enumerate(brain_img_arr): img_name = str(os.path.splitext(os.path.basename(file))[0]) @@ -387,6 +389,7 @@ def atlasBrainMatch( peak_arr_flat = [] peak_arr = [] + # Initialize empty lists for alignment coordinates dlc_pts = [] atlas_pts = [] sensory_peak_pts = [] @@ -427,7 +430,7 @@ def atlasBrainMatch( atlas_list = [atlas_list[i] for i in landmark_arr] # Initialize result as max value - landmark_indices = landmark_indices[0 : len(landmark_arr)] + landmark_indices = landmark_indices[0: len(landmark_arr)] atlas_indices = landmark_arr pts_dist = np.absolute( @@ -490,6 +493,7 @@ def atlasBrainMatch( im = np.uint8(im) im = cv2.resize(im, (512, 512)) + # Select which atlases to use (all in atlases subfolder) if atlas_to_brain_align: if use_voxelmorph and not use_dlc: atlas_mask_dir = os.path.join( @@ -555,7 +559,7 @@ def atlasBrainMatch( ) if use_dlc: # First alignment of brain atlas using three cortical landmarks and standard affine transform - atlas_pts_for_input = np.array([atlas_pts[n][0 : len(dlc_pts[n])]]).astype( + atlas_pts_for_input = np.array([atlas_pts[n][0: len(dlc_pts[n])]]).astype( "float32" ) pts_for_input = np.array([dlc_pts[n]]).astype("float32") @@ -565,15 +569,24 @@ def atlasBrainMatch( else: align_val = n + # Decision tree depending on how many alignment points are available + # 2 points if len(atlas_pts_for_input[0]) == 2: atlas_pts_for_input = np.append( atlas_pts_for_input[0], [[0, 0]], axis=0 ) pts_for_input = np.append(pts_for_input[0], [[0, 0]], axis=0) + # 2 or fewer points if len(atlas_pts_for_input[0]) <= 2: warp_coords = cv2.estimateAffinePartial2D( atlas_pts_for_input, pts_for_input )[0] + + # Write the rotation matrix to a file + with open(os.path.join(output_mask_path, "{}_atlas_transform.txt".format(str(n))), "w") as f: + for row in warp_coords: + np.savetxt(f, [row], fmt='%f') # Saving each row of the matrix in text format + if atlas_to_brain_align: atlas_warped_left = cv2.warpAffine(im_left, warp_coords, (512, 512)) atlas_warped_right = cv2.warpAffine( @@ -593,9 +606,16 @@ def atlasBrainMatch( io.imsave(atlas_right_transform_path, atlas_warped_right) else: atlas_warped = cv2.warpAffine(im, warp_coords, (512, 512)) + # 3 points elif len(atlas_pts_for_input[0]) == 3: warp_coords = cv2.getAffineTransform(atlas_pts_for_input, pts_for_input) + # Write the rotation matrix to a file + with open(os.path.join(output_mask_path, "{}_atlas_transform.txt".format(str(n))), "w") as f: + for row in warp_coords: + np.savetxt(f, [row], fmt='%f') # Saving each row of the matrix in text format + atlas_warped = cv2.warpAffine(im, warp_coords, (512, 512)) + # 4 or more points elif len(atlas_pts_for_input[0]) >= 4: im_final_size = (512, 512) @@ -605,7 +625,7 @@ def atlasBrainMatch( right = np.argsort(right).tolist() right = [x + 1 for x in right] # if set([1, 3, 5, 7]).issubset(landmark_arr): - if set([0, 3, 5, 6]).issubset(landmark_arr) and len(landmark_arr) >= 7: + if {0, 3, 5, 6}.issubset(landmark_arr) and len(landmark_arr) >= 7: left = [0, 3, 5] right = [3, 5, 6] # OLD METHOD FOR PREFERENTIALLY USING TOP CENTRE AND LAMBDA @@ -626,16 +646,16 @@ def atlasBrainMatch( # left = [x for x in landmark_indices if x in range(0, 6)][0:2] # right = [x for x in landmark_indices if x in range(3, 9)][0:2] left = [ - landmark_arr.index(x) - for x in landmark_arr - if x in [0, 1, 2, 3, 4, 5] - ][0:3] + landmark_arr.index(x) + for x in landmark_arr + if x in [0, 1, 2, 3, 4, 5] + ][0:3] # right = [landmark_arr.index(x) for x in reversed(landmark_arr) if x in [8, 7, 6, 5, 4, 3]][0:3] right = [ - landmark_arr.index(x) - for x in landmark_arr - if x in [3, 4, 5, 6, 7, 8] - ][-3:] + landmark_arr.index(x) + for x in landmark_arr + if x in [3, 4, 5, 6, 7, 8] + ][-3:] print(landmark_indices) print(landmark_arr) print(left) @@ -711,9 +731,21 @@ def atlasBrainMatch( # ) warp_coords_left = cv2.getAffineTransform(atlas_pts_left, dlc_pts_left) + + # Write the rotation matrix to a file + with open(os.path.join(output_mask_path, "{}_atlas_transform_left.txt".format(str(n))), "w") as f: + for row in warp_coords_left: + np.savetxt(f, [row], fmt='%f') # Saving each row of the matrix in text format + warp_coords_right = cv2.getAffineTransform( atlas_pts_right, dlc_pts_right ) + + # Write the rotation matrix to a file + with open(os.path.join(output_mask_path, "{}_atlas_transform_right.txt".format(str(n))), "w") as f: + for row in warp_coords_right: + np.savetxt(f, [row], fmt='%f') # Saving each row of the matrix in text format + warp_coords_brain_atlas_left = cv2.getAffineTransform( dlc_pts_left, atlas_pts_left ) @@ -763,6 +795,7 @@ def atlasBrainMatch( atlas_warped = cv2.warpAffine(im, warp_coords, (512, 512)) # if atlas_to_brain_align: + # If 2 points if len(atlas_pts_for_input[0]) == 2: atlas_mask_left_warped = cv2.warpAffine( atlas_mask_left, warp_coords, (512, 512) @@ -773,8 +806,10 @@ def atlasBrainMatch( atlas_mask_warped = cv2.bitwise_or( atlas_mask_left_warped, atlas_mask_right_warped ) + # If 3 points if len(atlas_pts_for_input[0]) == 3: atlas_mask_warped = cv2.warpAffine(atlas_mask, warp_coords, (512, 512)) + # If 4 or more points if len(atlas_pts_for_input[0]) >= 4: atlas_mask_left_warped = cv2.warpAffine( atlas_mask_left, warp_coords_left, (512, 512) @@ -788,12 +823,10 @@ def atlasBrainMatch( atlas_mask_warped = np.uint8(atlas_mask_warped) io.imsave(mask_warped_path_alt_left, atlas_mask_left_warped) io.imsave(mask_warped_path_alt_right, atlas_mask_right_warped) - # brain_to_atlas_mask = cv2.bitwise_or( - # atlas_mask_warped, im - # ) - # io.imsave(brain_to_atlas_mask_path, brain_to_atlas_mask) + hemispheres = ["left", "right"] - olfactory_bulbs_to_use = [] + + # olfactory_bulbs_to_use = [] if olfactory_check and use_unet: if align_once and n != 0: olfactory_bulbs = olfactory_bulbs_to_use_pre_align_list[0] @@ -825,22 +858,22 @@ def atlasBrainMatch( if olfactory_check and use_unet: if len(olfactory_bulbs) >= 1: bulb = olfactory_bulbs[0] - bulb_fill = 300 + # bulb_fill = 300 else: mask_path = mask_warped_path_alt_right mask_warped_to_use = atlas_mask_right_warped if olfactory_check and use_unet: if len(olfactory_bulbs) > 1: bulb = olfactory_bulbs[1] - bulb_fill = 400 + # bulb_fill = 400 if olfactory_check and use_unet: - olfactory_bulbs_to_use = olfactory_bulbs + # olfactory_bulbs_to_use = olfactory_bulbs try: cv2.fillPoly( mask_warped_to_use, pts=[bulb], color=[255, 255, 255] ) io.imsave(mask_path, mask_warped_to_use) - except: + except OSError: print("No olfactory bulb found!") mask_warped_to_use = cv2.cvtColor( mask_warped_to_use, cv2.COLOR_BGR2GRAY @@ -1048,7 +1081,6 @@ def atlasBrainMatch( io.imsave(mask_warped_path, atlas_mask) else: io.imsave(mask_warped_path, dst) - # if atlas_to_brain_align: if use_voxelmorph: atlas_mask_warped = atlas_mask else: @@ -1060,6 +1092,7 @@ def atlasBrainMatch( atlas_mask_warped = np.uint8(atlas_mask_warped) original_label = True io.imsave(mask_warped_path, atlas_mask_warped) + # Resize images back to 512x512 dst = cv2.resize(dst, (im.shape[0], im.shape[1])) atlas_path = os.path.join(output_mask_path, "{}_atlas.png".format(str(n))) @@ -1116,7 +1149,7 @@ def atlasBrainMatch( else: n_to_use = 1 for (n_post, dst_post), vxm_template_post in zip( - enumerate([dst_list[n_to_use]]), [vxm_template_list[n_to_use]] + enumerate([dst_list[n_to_use]]), [vxm_template_list[n_to_use]] ): output_img, flow_post = voxelmorph_align( voxelmorph_model_path, diff --git a/mesonet/data.py b/mesonet/data.py index a5f5c6b..cd14867 100755 --- a/mesonet/data.py +++ b/mesonet/data.py @@ -5,7 +5,6 @@ Licensed under the Creative Commons Attribution 4.0 International License (see LICENSE for details) This file has been adapted from data.py in https://github.com/zhixuhao/unet """ -from __future__ import print_function from keras.preprocessing.image import ImageDataGenerator import numpy as np import os diff --git a/mesonet/dlc_predict.py b/mesonet/dlc_predict.py index eb49fd8..8abe0c7 100755 --- a/mesonet/dlc_predict.py +++ b/mesonet/dlc_predict.py @@ -253,6 +253,7 @@ def DLCPredictBehavior(config, input_file, output): if not os.path.isdir(video_output_path[0]): os.mkdir(video_output_path[0]) + out = cv2.VideoWriter(video_name, cv2.VideoWriter_fourcc(*"MP4V"), 30, size) for i in range(len(img_array)): out.write(img_array[i]) diff --git a/mesonet/gui_test.py b/mesonet/gui_test.py index d58cd74..04d1288 100755 --- a/mesonet/gui_test.py +++ b/mesonet/gui_test.py @@ -32,6 +32,19 @@ class Gui(object): def __init__(self, git_repo, config_file): # The main window of the app + self.existTransformCheck = None + self.flowEntryBox = None + self.flowEntryButton = None + self.flowName_str = None + self.flowEntryLabel = None + self.templateEntryBox = None + self.templateEntryButton = None + self.templateName_str = None + self.templateEntryLabel = None + self.vxmModelListBox = None + self.vxmModelLabel = None + self.vxm_model_select = None + self.vxm_window = None self.root = Tk() self.root.resizable(False, False) diff --git a/mesonet/gui_train.py b/mesonet/gui_train.py index 6c238d1..005e813 100755 --- a/mesonet/gui_train.py +++ b/mesonet/gui_train.py @@ -33,6 +33,13 @@ class GuiTrain: DEFAULT_NAME = "Labeler" def __init__(self): + self.old_y = None + self.old_x = None + self.image_resize = None + self.imageFileName = None + self.j = None + self.picLen = None + self.imgDisplayed = None self.root_train = Tk() self.root_train.resizable(False, False) self.Title = self.root_train.title("MesoNet Trainer") @@ -239,11 +246,11 @@ def __init__(self): # Image controls # Buttons below will only display if an image is displayed self.nextButton = Button( - self.root_train, text="->", command=lambda: self.forward(None) + self.root_train, text="->", command=lambda: self.forward() ) self.nextButton.grid(row=14, column=2, columnspan=1) self.previousButton = Button( - self.root_train, text="<-", command=lambda: self.backward(None) + self.root_train, text="<-", command=lambda: self.backward() ) self.previousButton.grid(row=14, column=0, columnspan=1) @@ -360,12 +367,12 @@ def ImageDisplay(self, delta, folderName, reset): imageNumLabel = Label(self.root_train, textvariable=imageNumPrep) imageNumLabel.grid(row=4, column=2, columnspan=1) - def forward(self, event): + def forward(self): self.ImageDisplay(1, self.folderName, 0) self.mask = Image.new("L", (self.cv_dim, self.cv_dim)) self.draw = ImageDraw.Draw(self.mask) - def backward(self, event): + def backward(self): self.ImageDisplay(-1, self.folderName, 0) self.mask = Image.new("L", (self.cv_dim, self.cv_dim)) self.draw = ImageDraw.Draw(self.mask) @@ -405,7 +412,7 @@ def paint(self, event): self.old_x = event.x self.old_y = event.y - def reset(self, event): + def reset(self): self.old_x, self.old_y = None, None def mask_save(self, mask_folder, img_name): diff --git a/mesonet/img_augment.py b/mesonet/img_augment.py index c91e0d1..366974f 100755 --- a/mesonet/img_augment.py +++ b/mesonet/img_augment.py @@ -115,14 +115,14 @@ def img_augment_run(input_path, output_path, coords_input, data_gen_args): def img_augment( - input_path, - output_path, - coords_input, - brightness_range=0.3, - rotation_range=0.3, - width_shift_range=0.05, - height_shift_range=0.05, - zoom_range=0.05, + input_path, + output_path, + coords_input, + brightness_range=0.3, + rotation_range=0.3, + width_shift_range=0.05, + height_shift_range=0.05, + zoom_range=0.05, ): data_gen_args = dict( rotation_range=rotation_range, diff --git a/mesonet/mask_functions.py b/mesonet/mask_functions.py index 64715d3..2302a60 100755 --- a/mesonet/mask_functions.py +++ b/mesonet/mask_functions.py @@ -7,7 +7,7 @@ """ from mesonet.utils import natural_sort_key import numpy as np -import scipy.io as sio +from scipy.io import loadmat, savemat import os import glob import skimage.io as io @@ -16,7 +16,6 @@ import cv2 import imageio import imutils -import scipy import pylab from PIL import Image import pandas as pd @@ -376,7 +375,7 @@ def applyMask( colors = [cm(1.0 * i / NUM_COLORS)[0:3] for i in range(NUM_COLORS)] colors = [tuple(color_idx * 255 for color_idx in color_t) for color_t in colors] for file in mat_files: - mat = scipy.io.loadmat( + mat = loadmat( os.path.join(git_repo_base, "atlases/mat_contour_base/", file) ) mat = mat["vect"] @@ -384,38 +383,6 @@ def applyMask( base_c = cv2.findContours(thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE) base_c = imutils.grab_contours(base_c) base_c_max.append(max(base_c, key=cv2.contourArea)) - # if not atlas_to_brain_align and use_unet: - # # FOR ALIGNING ATLAS TO BRAIN - # num_images = len(glob.glob(os.path.join(mask_path, "*_brain_warp*"))) - # output = os.path.join(mask_path, "..") - # from mesonet.predict_regions import predictRegion - # - # mask_generate = True - # tif_list = glob.glob(os.path.join(image_path, "*tif")) - # if tif_list: - # input_path = image_path - # else: - # input_path = mask_path - # predictRegion( - # input_path, - # num_images, - # model, - # output, - # mat_save, - # threshold, - # mask_generate, - # git_repo_base, - # atlas_to_brain_align, - # dlc_pts, - # atlas_pts, - # olfactory_check, - # use_unet, - # plot_landmarks, - # align_once, - # atlas_label_list, - # region_labels, - # original_label, - # ) for i, item in enumerate(image_name_arr): label_num = 0 if not atlas_to_brain_align: @@ -465,12 +432,9 @@ def applyMask( io.imsave(os.path.join(save_path, "{}_mask_binary.png".format(i)), mask_color) # Marker labelling # noise removal - kernel = np.ones((3, 3), np.uint8) # 3, 3 + # kernel = np.ones((3, 3), np.uint8) # 3, 3 mask_color = np.uint8(mask_color) thresh_atlas, atlas_bw = cv2.threshold(mask_color, 128, 255, 0) - # if atlas_to_brain_align and use_dlc: - # atlas_bw = cv2.dilate(atlas_bw, kernel, iterations=1) # 1 - # io.imsave(os.path.join(save_path, "{}_atlas_binary.png".format(i)), atlas_bw) if not atlas_to_brain_align: watershed_run_rule = True @@ -880,7 +844,7 @@ def applyMask( os.path.join(segmented_save_path, "mat_contour_centre") ): os.mkdir(os.path.join(segmented_save_path, "mat_contour_centre")) - sio.savemat( + savemat( os.path.join( segmented_save_path, "mat_contour/roi_{}_{}_{}_{}.mat".format( @@ -894,7 +858,7 @@ def applyMask( }, appendmat=False, ) - sio.savemat( + savemat( os.path.join( segmented_save_path, "mat_contour_centre/roi_centre_{}_{}_{}_{}.mat".format( @@ -908,7 +872,7 @@ def applyMask( }, appendmat=False, ) - sio.savemat( + savemat( os.path.join( segmented_save_path, "mat_contour_centre/rel_roi_centre_{}_{}_{}_{}.mat".format( @@ -951,7 +915,7 @@ def applyMask( ) img_trans_for_mat = np.uint8(img_transparent) if mat_save: - sio.savemat( + savemat( os.path.join( segmented_save_path, "mat_contour/transparent_{}".format(i) ), diff --git a/mesonet/utils.py b/mesonet/utils.py index 50f1c21..cb859a5 100755 --- a/mesonet/utils.py +++ b/mesonet/utils.py @@ -258,7 +258,6 @@ def find_git_repo(): in_colab = False try: import google.colab - in_colab = True except: in_colab = False diff --git a/setup.py b/setup.py index 0d13cdc..0bb6bc3 100755 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ # pip install "notebook<7.0.0" "tensorflow-macos<2.13.0" "tensorflow-metal" setuptools.setup( name='mesonet', - version='1.20', + version='1.21', author="Brandon Forys", author_email="brandon.forys@psych.ubc.ca", description="An automatic brain region identification and segmentation toolbox.", From f5b61c35ffeb1752d22fc951845934e6de0ca23a Mon Sep 17 00:00:00 2001 From: bf777 Date: Tue, 22 Oct 2024 12:10:01 -0700 Subject: [PATCH 2/2] Added .DS_Store to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 1593fb6..99bf3ab 100755 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ dist/ *.xml *.iml *.idea +*.DS_Store # U-net models (user needs to download these manually as they are too large to be hosted on GitHub) mesonet/models/*.hdf5