def localization_fv(data3dr, voxelsize_mm, seeds=None, unique_cls=None): # scale import scipy import numpy as np import os.path as op try: from lisa import organ_localizator except: import organ_localizator import organ_localizator fvall = organ_localizator.localization_fv(data3dr, voxelsize_mm) return combine_fv_and_seeds([fvall], seeds, unique_cls)
def intensity_localization_fv(data3dr, voxelsize_mm, seeds=None, unique_cls=None): # scale """ Use organ_localizator features plus intensity features :param data3dr: :param voxelsize_mm: :param seeds: :param unique_cls: :return: """ import scipy import numpy as np import os.path as op try: from lisa import organ_localizator except: import organ_localizator f0 = scipy.ndimage.filters.gaussian_filter(data3dr, sigma=0.5).reshape(-1, 1) f1 = scipy.ndimage.filters.gaussian_filter(data3dr, sigma=3).reshape(-1, 1) import organ_localizator fvall = organ_localizator.localization_fv(data3dr, voxelsize_mm) # fvall = organ_localizator.localization_intensity_fv(data3dr, voxelsize_mm) fv = np.concatenate( [ f0, f1, # f2, f3, # f4, # fd1, fd2, fd3, fd4, fd5, fd6, fvall, # f6, f7, f8, ], 1) if seeds is not None: # logger.debug("seeds " + str(seeds)) # print "seeds ", seeds sd = seeds.reshape(-1, 1) selection = np.in1d(sd, unique_cls) fv = fv[selection] sd = sd[selection] # sd = sd[] return fv, sd return fv
def intensity_localization_fv(data3dr, voxelsize_mm, seeds=None, unique_cls=None): # scale """ Use organ_localizator features plus intensity features :param data3dr: :param voxelsize_mm: :param seeds: :param unique_cls: :return: """ import scipy import numpy as np import os.path as op try: from lisa import organ_localizator except: import organ_localizator f0 = scipy.ndimage.filters.gaussian_filter(data3dr, sigma=0.5).reshape(-1, 1) f1 = scipy.ndimage.filters.gaussian_filter(data3dr, sigma=3).reshape(-1, 1) import organ_localizator fvall = organ_localizator.localization_fv(data3dr, voxelsize_mm) # fvall = organ_localizator.localization_intensity_fv(data3dr, voxelsize_mm) fv = np.concatenate([ f0, f1, # f2, f3, # f4, # fd1, fd2, fd3, fd4, fd5, fd6, fvall, # f6, f7, f8, ], 1) if seeds is not None: # logger.debug("seeds " + str(seeds)) # print "seeds ", seeds sd = seeds.reshape(-1,1) selection = np.in1d(sd, unique_cls) fv = fv[selection] sd = sd[selection] # sd = sd[] return fv, sd return fv