예제 #1
0
    def __init__(self, cube, header, slice_sizes=None, phys_units=False):
        super(VCA, self).__init__()

        self.cube = cube.astype("float64")
        if np.isnan(self.cube).any():
            self.cube[np.isnan(self.cube)] = 0
            # Feel like this should be more specific
            self.good_channel_count = np.sum(self.cube[0, :, :] != 0)
        self.header = header
        self.shape = self.cube.shape

        if slice_sizes is None:
            self.slice_sizes = [1.0, 5.0, 10.0, 20.0]
        else:
            self.slice_sizes = slice_sizes

        self.degraded_cubes = []
        for size in self.slice_sizes:
            self.degraded_cubes.append(
                change_slice_thickness(self.cube, slice_thickness=size))

        self.phys_units_flag = False
        if phys_units:
            self.phys_units_flag = True

        self.ps2D = []
        self.ps1D = []
        self.freq = None
예제 #2
0
파일: vca.py 프로젝트: jrobbfed/carma
    def __init__(self, cube, header=None, slice_size=None):
        super(VCA, self).__init__()

        self.input_data_header(cube, header)

        if np.isnan(self.data).any():
            self.data[np.isnan(self.data)] = 0

        if slice_size is None:
            self.slice_size = 1.0

        if slice_size != 1.0:
            self.data = \
                change_slice_thickness(self.data,
                                       slice_thickness=self.slice_size)

        self._ps1D_stddev = None
예제 #3
0
    def __init__(self, cube, header, slice_size=None, phys_units=False):
        super(VCA, self).__init__()

        self.cube = cube.astype("float64")
        if np.isnan(self.cube).any():
            self.cube[np.isnan(self.cube)] = 0
            # Feel like this should be more specific
            self.good_channel_count = np.sum(self.cube.max(axis=0) != 0)
        self.header = header
        self.shape = self.cube.shape

        if slice_size is None:
            self.slice_size = 1.0

        if slice_size != 1.0:
            self.cube = change_slice_thickness(self.cube.copy(), slice_thickness=self.slice_size)

        self.phys_units_flag = False
        if phys_units:
            self.phys_units_flag = True