diff --git a/README.md b/README.md index 52a7716..17787fa 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,11 @@ An implementation of 3D brain MRI super-resolution method by image gradient-tensor distance based patch clustering ### Conference Abstract - - 3D Brain MRI Super-Resolution with Image Gradient Tensor Feature Clustering [[Poster]](https://anyscreeninc.com/PF/OHBM/2021/OHBM-Educational-Courses/pdf_poster_files/Seongsu_Park60785c7f217ee/Seongsu_Park.pdf) + - 3D Brain MRI Super-Resolution with Image Gradient Tensor Feature Clustering [[Poster]](https://github.com/Snailpong/SR_Tensor/files/7373293/ohbm.pdf) - Organization for Human Brain Mapping Annual Meeting, 2021 -### Journal Paper - - Will be updated.. - - ## Requirments - Both Linux and Windows are supported. diff --git a/feature_model.py b/feature_model.py index 5ddc85d..5d83eaa 100644 --- a/feature_model.py +++ b/feature_model.py @@ -19,7 +19,7 @@ def get_invarient_set(l1, l2, l3): l3 = math.sqrt(l3) trace = l1 + l2 + l3 mean_la = trace / 3 - fa = ((l1 - mean_la)**2 + (l2 - mean_la)**2 + (l3 - mean_la)**2)/ (l1**2 + l2**2 + l3**2) + fa = math.sqrt(((l1 - mean_la)**2 + (l2 - mean_la)**2 + (l3 - mean_la)**2) / (l1**2 + l2**2 + l3**2) / 2.) mode = (-l1-l2+2*l3)*(2*l1-l2-l3)*(-l1+2*l2-l3)/2/pow(l1**2+l2**2+l3**2-l1*l2-l1*l3-l2*l3, 1.5) return trace, fa, mode diff --git a/preprocessing.py b/preprocessing.py index 13ea6e0..140ea39 100644 --- a/preprocessing.py +++ b/preprocessing.py @@ -8,11 +8,11 @@ def get_array_data(file, training): - raw_image = nib.load(file).get_fdata() - raw_array = np.array(raw_array, dtype=np.float32) + raw_image = nib.load(file) + raw_array = np.array(raw_image.get_fdata(), dtype=np.float32) raw_header = raw_image.header.copy() - clipped_image = clip_image(raw_image) + clipped_image = clip_image(raw_array) im = mod_crop(clipped_image, C.R) slice_area = crop_slice(im, C.PATCH_HALF, C.R)