Esempio n. 1
0
    def set_res(self):
        """
        Calulates initial value for res if this is not given.
        :return: None
        """
        self.res = np.zeros(self.geo.nVoxel, dtype=np.float32)
        init = self.init
        verbose = self.verbose
        if init == "multigrid":
            if verbose:
                print("init multigrid in progress...")
                print("default blocksize=1 for init_multigrid(OS_SART)")
            self.res = init_multigrid(self.proj, self.geo, self.angles, alg="SART")
            if verbose:
                print("init multigrid complete.")
        if init == "FDK":
            self.res = FDK(self.proj, self.geo, self.angles)

        if isinstance(init, np.ndarray):
            if (self.geo.nVoxel == init.shape).all():

                self.res = init

            else:
                raise ValueError("wrong dimension of array for initialisation")
Esempio n. 2
0
    def set_res(self):
        """
        Calulates initial value for res if this is not given.
        :return: None
        """
        setattr(self, 'res', np.zeros(self.geo.nVoxel, dtype=np.float32))
        init = self.init
        verbose = self.verbose
        if init == 'multigrid':
            if verbose:
                print('init multigrid in progress...')
                print('default blocksize=1 for init_multigrid(OS_SART)')
            self.res = init_multigrid(self.proj,
                                      self.geo,
                                      self.angles,
                                      alg='SART')
            if verbose:
                print('init multigrid complete.')
        if init == 'FDK':
            self.res = FDK(self.proj, self.geo, self.angles)

        if isinstance(init, np.ndarray):
            if (self.geo.nVoxel == init.shape).all():

                self.res = init

            else:
                raise ValueError('wrong dimension of array for initialisation')
Esempio n. 3
0
    def set_res(self):
        """
        Calulates initial value for res if this is not given.
        :return: None
        """
        setattr(self, 'res', np.zeros(self.geo.nVoxel, dtype=np.float32))
        init = self.init
        verbose = self.verbose
        if init == 'multigrid':
            if verbose:
                print('init multigrid in progress...')
                print('default blocksize=1 for init_multigrid(OS_SART)')
            self.res = init_multigrid(self.proj, self.geo, self.angles, alg='SART')
            if verbose:
                print('init multigrid complete.')
        if init == 'FDK':
            self.res = FDK(self.proj, self.geo, self.angles)

        if type(init) == np.ndarray:
            if (self.geo.nVoxel == init.shape).all():

                self.res = init

            else:
                raise ValueError('wrong dimension of array for initialisation')