def init_filters_and_variables(self):
        self.num_filters = 6
        self.num_variables = 1 + self.num_filters

        # Start the sigmoids at weak strengths
        self.sigmoid_beta = 0.0625
        self.sigmoid_eta = 0.5
        self.sigmoid_0 = sigmoid.Sigmoid(self.sigmoid_beta, self.sigmoid_eta)
        self.sigmoid_4 = sigmoid.Sigmoid(self.sigmoid_beta, self.sigmoid_eta)

        x_dimension_idx = 0
        y_dimension_idx = 1
        z_dimension_idx = 2

        z_voxel_layers = self.size[2]
        self.layering_z_1 = layering.Layering(z_dimension_idx,
                                              self.num_z_layers)

        alpha = 8
        self.blur_half_width = blur_half_width_voxels
        #
        # This notation is slightly confusing, but it is meant to be the
        # direction you blur when you are on the layer corresponding to x-
        # or y-layering.  So, if you are layering in x, then you blur in y
        # and vice versa.
        #
        max_blur_x_2 = square_blur.SquareBlur(alpha,
                                              [0, self.blur_half_width, 0])
        max_blur_y_2 = square_blur.SquareBlur(alpha,
                                              [self.blur_half_width, 0, 0])
        self.max_blur_xy_2 = [max_blur_x_2, max_blur_y_2]

        single_layer = 1
        layering_x_3 = layering.Layering(x_dimension_idx, single_layer)
        layering_y_3 = layering.Layering(y_dimension_idx, single_layer)
        self.layering_xy_3 = [layering_x_3, layering_y_3]

        scale_min = self.permittivity_bounds[0]
        scale_max = self.permittivity_bounds[1]
        self.scale_5 = scale.Scale([scale_min, scale_max])

        # Initialize the filter chain
        self.filters = [
            self.sigmoid_0, self.layering_z_1, self.max_blur_xy_2,
            self.layering_xy_3, self.sigmoid_4, self.scale_5
        ]

        self.init_variables()
示例#2
0
    def init_filters_and_variables(self):
        self.num_filters = 3
        self.num_variables = 1 + self.num_filters

        x_dimension_idx = 0
        y_dimension_idx = 1
        z_dimension_idx = 2

        z_voxel_layers = self.size[2]
        self.layering_z_0 = layering.Layering(z_dimension_idx,
                                              self.num_z_layers, [0, 1],
                                              self.spacer_height_voxels, 0.0)

        alpha = 8
        self.blur_half_width = blur_half_width_voxels
        #
        # This notation is slightly confusing, but it is meant to be the
        # direction you blur when you are on the layer corresponding to x-
        # or y-layering.  So, if you are layering in x, then you blur in y
        # and vice versa.
        #
        self.max_blur_xy_1 = square_blur.SquareBlur(
            alpha, [self.blur_half_width, self.blur_half_width, 0])

        scale_min = self.permittivity_bounds[0]
        scale_max = self.permittivity_bounds[1]
        self.scale_2 = scale.Scale([scale_min, scale_max])

        # Initialize the filter chain
        self.filters = [self.layering_z_0, self.max_blur_xy_1, self.scale_2]

        self.init_variables()
    def init_filters_and_variables(self):
        self.num_filters = 6
        self.num_variables = 1 + self.num_filters

        # Start the sigmoids at weak strengths
        self.sigmoid_beta = 0.0625
        self.sigmoid_eta = 0.5
        self.sigmoid_0 = sigmoid.Sigmoid(self.sigmoid_beta, self.sigmoid_eta)
        self.sigmoid_2 = sigmoid.Sigmoid(self.sigmoid_beta, self.sigmoid_eta)

        x_dimension_idx = 0
        y_dimension_idx = 1
        z_dimension_idx = 2

        alpha = 8
        # I truly dislike this silent parameter passing, like truly scarily bad coding
        self.blur_half_width = max_blur_filter_half_width

        # This notation is slightly confusing, but it is meant to be the
        # direction you blur when you are on the layer corresponding to x-
        # or y-layering.  So, if you are layering in x, then you blur in y
        # and vice versa.

        self.max_blur_xy_1 = square_blur.SquareBlur(
            alpha, [self.blur_half_width, self.blur_half_width, 0])

        self.gaussian_blur_3 = GaussianBlur(gaussian_blur_filter_sigma)

        z_voxel_layers = self.size[2]
        self.layering_z_4 = layering.Layering(z_dimension_idx,
                                              self.num_z_layers, [0, 1],
                                              self.spacer_height_voxels, 0.0)

        scale_min = self.permittivity_bounds[0]
        scale_max = self.permittivity_bounds[1]
        self.scale_5 = scale.Scale([scale_min, scale_max])

        # Initialize the filter chain
        self.filters = [
            self.sigmoid_0, self.max_blur_xy_1, self.sigmoid_2,
            self.gaussian_blur_3, self.layering_z_4, self.scale_5
        ]

        self.init_variables()