a48b055a628bfa648a0b5a371838848e997440e2,unet3d/normalize.py,,get_complete_foreground,#,18
Before Change
def get_complete_foreground(subject_folders):
for i, subject_folder in enumerate(subject_folders):
background_path = os.path.join(subject_folder, "background.nii.gz")
image = nib.load(background_path)
image_foreground = image.get_data() == 0
if i == 0:
foreground = image_foreground
reference_image = image
else:
foreground[image_foreground] = 1
return new_img_like(reference_image, foreground)
def normalize_data(data, mean, std):
data -= mean[:, np.newaxis, np.newaxis, np.newaxis]
After Change
else:
foreground[subject_foreground > 0] = 1
return new_img_like(nib.load(training_data_files[0][-1]), foreground)
def get_foreground_from_set_of_files(set_of_files, background_value=0, tolerance=0.00001):
for i, image_file in enumerate(set_of_files):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: ellisdg/3DUnetCNN
Commit Name: a48b055a628bfa648a0b5a371838848e997440e2
Time: 2017-05-17
Author: david.ellis@unmc.edu
File Name: unet3d/normalize.py
Class Name:
Method Name: get_complete_foreground
Project Name: ellisdg/3DUnetCNN
Commit Name: e6a8a482f15803b24fc4bda6e2a0bd001ca77c87
Time: 2017-04-07
Author: david.ellis@unmc.edu
File Name: data.py
Class Name:
Method Name: read_subject_folder
Project Name: nilearn/nilearn
Commit Name: fa46d145b5db93e7a922135ffda087abab2760de
Time: 2018-10-26
Author: michaelnotter@hotmail.com
File Name: nilearn/image/image.py
Class Name:
Method Name: clean_img