Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PET Operator #2

Open
mehrhardt opened this issue Jul 26, 2018 · 6 comments
Open

PET Operator #2

mehrhardt opened this issue Jul 26, 2018 · 6 comments

Comments

@mehrhardt
Copy link


A SIRF Acquisition Model <=> A CIL Operator
A.direct(x)
A.adjoint(x)

@paskino
Copy link
Contributor

paskino commented Jul 26, 2018

@mehrhardt
Copy link
Author

As discussed with @KrisThielemans we need to change direct slightly. It should contain only the linear part of the forward operator (important: needs to be documented!!!!).

@mehrhardt
Copy link
Author

We also want to have subset functionality in some way. It would be good to write in python A[i].direct(x) to project the ith subset.

@paskino
Copy link
Contributor

paskino commented Jul 27, 2018

Specifically this needs to create a AcquisitionModel and not call

    acq_model = AcquisitionModelUsingRayTracingMatrix()
    ## avoid calling these to have only linear term
    acq_model.set_additive_term(add)
    acq_model.set_background_term(bck)

    print('projecting image...')
    # project the image to obtain simulated acquisition data
    # data from raw_data_file is used as a template
    acq_template = AcquisitionData(raw_data_file)
    acq_model.set_up(acq_template, image)
    simulated_data = acq_model.forward(image)

paskino added a commit that referenced this issue Jul 27, 2018
notice that it's not taking into consideration
#2 (comment)
@mehrhardt
Copy link
Author

mehrhardt commented Jul 30, 2018

For the subsets, one could "hack" this into python as

class AcquisitionModelSubset():
    def __init__(subset_num, num_subsets):
        self.AcquisitionModel = pet.AcquisitionModel(...)
        self.subset_num = subset_num
        self.num_subsets = num_subsets

    def direct(self, x):
        return self.AcquisitionModel.direct(x, subset_num=self.subset_num, num_subsets=self.num_subsets)

    def adjoint(self x):
        return self.AcquisitionModel.adjoint(x, subset_num=self.subset_num, num_subsets=self.num_subsets) 

then with
A = [pet.AcquisitionModelSubset(subset_num=i, num_subsets=m) for i in range(m)]
one can iterate over all subsets as

for i in range(m):
    A[i].direct(x)

This solution could be similarly adapted to the c code if people are interested.

@mehrhardt
Copy link
Author

I suppose this is done? @paskino

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants