Open epapoutsellis opened 3 years ago
I think we need a multichannel processor rather than implementing these versions by hand.
Currently this is not implemented as it may not be clear what it is expected to be done on the multichannel dataset. If channel wise repetition is what is required, we can have 2 options:
ChannelwiseProcessor
similarly to the ChannelwiseOperator
to operate on the single channels in the data and return a multichannel dataset
ig3d = ig4d.get_slice(channel=1)
ag3d = ag4d.get_slice(channel=1)
fbp = FBP(ig3d, ag3d)
fbp.set_input(data)
recon3d = fbp.get_output()
# this fails
# fbp4d = FBP(ig4d, ag4d)
### Option 1
ig3d = ig4d.get_slice(channel=1)
ag3d = ag4d.get_slice(channel=1)
fbp = FBP(ig3d, ag3d)
fbp4d = ChannelwiseProcessor(fbp, num_channels=ag4d.channels)
fbp4d.set_input(data4d)
recon4d = fbp4d.get_output()
# or
recon4d = ChannelwiseProcessor(fbp, num_channels=ag4d.channels)(data4d)
### Option 2: do nothing
ig3d = ig4d.get_slice(channel=0)
ag3d = ag4d.get_slice(channel=0)
fbp = FBP(ig3d, ag3d)
recon4d = ig4d.allocate(None)
for ch in range(ag4d.channels):
fbp.set_input(data4d.get_slice(channel=ch))
recon4d.fill(fbp.get_output(), channel=ch)
### Option 3: not an option
fbp4d = FBP(ig4d, ag4d, isMultichannel=True)
recon4d = fbp4d(data4d)
I like the ChannelwiseProcessor. So that would work in the same way for other processors like RingRemover, Masker and CentreOfRotationCorrector?
On Fri, 7 May 2021, 13:19 Edoardo Pasca, @.***> wrote:
Currently this is not implemented as it may not be clear what it is expected to be done on the multichannel dataset. If channel wise repetition is what is required, we can have 2 options:
- create a ChannelwiseProcessor similarly to the ChannelwiseOperator to operate on the single channels in the data and return a multichannel dataset
- write your own for loop on the channels as option 2 below
ig3d = ig4d.get_slice(channel=1)ag3d = ag4d.get_slice(channel=1) fbp = FBP(ig3d, ag3d)fbp.set_input(data)recon3d = fbp.get_output()
this fails# fbp4d = FBP(ig4d, ag4d)
Option 1ig3d = ig4d.get_slice(channel=1)ag3d = ag4d.get_slice(channel=1)fbp = FBP(ig3d, ag3d)
fbp4d = ChannelwiseProcessor(fbp, num_channels=ag4d.channels)fbp4d.set_input(data4d)recon4d = fbp4d.get_output()# or recon4d = ChannelwiseProcessor(fbp, num_channels=ag4d.channels)(data4d)
Option 2: do nothingig3d = ig4d.get_slice(channel=0)ag3d = ag4d.get_slice(channel=0)fbp = FBP(ig3d, ag3d)
recon4d = ig4d.allocate(None)for ch in range(ag4d.channels): fbp.set_input(data4d.get_slice(channel=ch)) recon4d.fill(fbp.get_output(), channel=ch)
Option 3: not an optionfbp4d = FBP(ig4d, ag4d, isMultichannel=True)recon4d = fbp4d(data4d)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vais-ral/CCPi-astra/issues/91#issuecomment-834281770, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACMDSCBNXLM7ETTWQRK4DG3TMPEFBANCNFSM44FXWXCA .
Yes, but I think RingRemover and Masker already handle 4D data. Centre of rotation is an interesting one, I don't think we can have different geometries in different channels, and it works by updating the geometry rather than changing the data, I'm not sure what we'd want to do here.
I am trying to do FBP for 3D+channel data and get this error
See here.