Skip to content

Write LOR#6

Open
jmbenlloch wants to merge 12 commits intojacg:masterfrom
jmbenlloch:test-lor
Open

Write LOR#6
jmbenlloch wants to merge 12 commits intojacg:masterfrom
jmbenlloch:test-lor

Conversation

@jmbenlloch
Copy link
Contributor

This PR is a simple (and dirty) way if writing LORs into HDF5. LXe has been replaced by air and only events with 2 gammas will be written. I still need to define a way to pass the output filename in the configuration file.

In any case, I have not been able to read with petalo_rust a sample file produced with this PR. The HDF5 file can be read without error with different tools (h5ls, hdfview, python), but the rust code shows this error:

$ cargo run --bin mlem --release -- -i 6 -r 20 -f data/in/test_lor.h5 
    Finished release [optimized + debuginfo] target(s) in 0.11s
     Running `target/release/mlem -i 6 -r 20 -f data/in/test_lor.h5`
Float precision: 32 bits
Error: slice extends beyond dataspace bounds

I have included in a commit the same file I've used. Can you check if you can run the rust code with this file?

@jacg
Copy link
Owner

jacg commented Apr 29, 2021

test_lor.h5 contains 159 rows; mlem tries to load a million by default.

Try adding -e 0..159 to the command line.

Add a -h to the command line for more details.

jacg added 7 commits April 30, 2021 04:16
atan cannot distinguish between opposite sides of the circle, so information was
being lost, and all the reconstructed LORs were missing the region of interest.
This helps with live documentation in IDEs.
@jacg
Copy link
Owner

jacg commented May 2, 2021

Halving the radii in the phantom, results in mlem reconstructing sensible images.

In the phantom I have pushed, the body activity is zero, just to be absolutely sure I wasn't accidentally looking at some other images.

There are some interesting artefacts in the (completely unrealistic) 20ps TOF images near the bottom of the notebook.

I have also pushed a commit to rustpetalo which adds the ability to set the number of events the notebook should read. This is useful if you want to test with G4 runs which generate less than 1 million LOR-containing events, which is the default that mlem, and therefore also the notebook use.

Do you want to do any tidying before we merge?

@jmbenlloch
Copy link
Contributor Author

Halving the radii in the phantom, results in mlem reconstructing sensible images.

I agree, I have the same results.

There are some interesting artefacts in the (completely unrealistic) 20ps TOF images near the bottom of the notebook.

I don't think that is relevant now. The method seems to work for sensible values.

I have also pushed a commit to rustpetalo which adds the ability to set the number of events the notebook should read

Perfect!

Do you want to do any tidying before we merge?

I have removed some commented blocks that I introduced and are not useful anymore. Besides that, I think this is ready for merge now.

@jacg
Copy link
Owner

jacg commented May 3, 2021

The trouble is, I'm not sure what to do with this. It's a proof of concept, but it doesn't really fit in with the 3 or 4 other things I'm working on at the moment. It's a valuable sanity check, so I definitely want to include it, but it's largely in abracadabra's main and there it's just getting in the way and conflicting with the other experiments I'm doing.

I'll leave it unmerged for now, and tidy it up and find a good home for it once the dust has settled a bit.

@jacg
Copy link
Owner

jacg commented May 4, 2021

Halving the radii in the phantom, results in mlem reconstructing sensible images.

Alternatively, doubling the ROI with mlem's -s/--size option, also gives sensible images. (Hard-wired it in notebooks/utils.py to try it out. So maybe this is another degree of freedom that should be added.)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants