Changeset 1210 for framspy


Ignore:
Timestamp:
04/02/23 20:39:42 (21 months ago)
Author:
Maciej Komosinski
Message:

EPSILON used only where necessary

File:
1 edited

Legend:

Unmodified
Added
Removed
  • framspy/dissimilarity/density-distribution.py

    r1208 r1210  
    188188        """
    189189
    190         min_x = np.min([np.min(array1[:,0]),np.min(array2[:,0])]) - self.EPSILON  # EPSILON added and removed to deal boundary voxels
    191         max_x = np.max([np.max(array1[:,0]),np.max(array2[:,0])]) + self.EPSILON
    192         min_y = np.min([np.min(array1[:,1]),np.min(array2[:,1])]) - self.EPSILON
    193         max_y = np.max([np.max(array1[:,1]),np.max(array2[:,1])]) + self.EPSILON
    194         min_z = np.min([np.min(array1[:,2]),np.min(array2[:,2])]) - self.EPSILON
    195         max_z = np.max([np.max(array1[:,2]),np.max(array2[:,2])]) + self.EPSILON
     190        min_x = np.min([np.min(array1[:,0]),np.min(array2[:,0])])
     191        max_x = np.max([np.max(array1[:,0]),np.max(array2[:,0])])
     192        min_y = np.min([np.min(array1[:,1]),np.min(array2[:,1])])
     193        max_y = np.max([np.max(array1[:,1]),np.max(array2[:,1])])
     194        min_z = np.min([np.min(array1[:,2]),np.min(array2[:,2])])
     195        max_z = np.max([np.max(array1[:,2]),np.max(array2[:,2])])
    196196
    197197        x_steps,x_step = np.linspace(min_x,max_x,self.steps,retstep=True)
     
    199199        z_steps,z_step = np.linspace(min_z,max_z,self.steps,retstep=True)
    200200       
    201         if self.steps == 1:
    202             x_steps = [min_x,max_x]
    203             y_steps = [min_y,max_y]
    204             z_steps = [min_z,max_z]
    205             x_step = max_x - min_x
    206             y_step = max_y - min_y
    207             z_step = max_z - min_z
     201        for intervals in (x_steps, y_steps, z_steps):  # EPSILON subtracted to deal with boundary voxels (one-sided open intervals and comparisons in loops in function getSignatures())
     202            intervals[0] -= self.EPSILON
    208203
    209204        steps_all = (x_steps,y_steps,z_steps)
Note: See TracChangeset for help on using the changeset viewer.