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

Recreate QRM Thorax Phantom #73

Open
Dale-Black opened this issue Dec 28, 2022 · 6 comments
Open

Recreate QRM Thorax Phantom #73

Dale-Black opened this issue Dec 28, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@Dale-Black
Copy link

Dale-Black commented Dec 28, 2022

I am working on a simple package that uses ImagePhantoms to recreate the QRM Thorax Phantom. How does someone use this package to combine various 3D geometries, like a cuboid that overlaps with a half-cylinder? So far, I have this Pluto notebook, but I have some questions. How do you combine different objects that form new boolean objects ((e.g. unique(image_combined) == [0, 1]) instead of an object that adds to the previous object (e.g. unique(image_combined) == [0.0, 1.0, 2.0, 3.0])?

image

image

@JeffFessler
Copy link
Member

This package is designed to provide phantom images and Radon transforms and Fourier transforms of objects, so everything is based on adding (or subtracting) components. That's why you see the bright middle where things are adding up. You can multiply images if you want, but you cannot multiply the objects because there are no simple Radon or Fourier properties for multiplication.
The simple way here is to approximate the outer structure with an elliptical cylinder.
If you really want half cylinders then you will need to implement that. The package is designed to be extensible, so it is definitely possible. And a PR for half cylinders would be welcome. Making a half cylinder phantom would be very easy using the existing cylinder code. But if you want the Radon and/or Fourier transforms of it then you will need to do some pencil and paper work to derive those. It is a solvable but a bit tedious perhaps.
Do you just want the phantom image, or do you also want the Radon transform?

@JeffFessler JeffFessler added the enhancement New feature or request label Dec 29, 2022
@JeffFessler
Copy link
Member

BTW, this is really a topic for Discussions not Issues. No big deal - just FYI.

@JeffFessler
Copy link
Member

BTW the aspect ratio of your image shown about is awry. I'm not sure how you displayed it. I've designed https://github.com/JeffFessler/MIRTjim.jl to handle aspect ratios appropriately for data with units. I use it in all the examples in this package and other packages I write. It does not have a slice picker bar built-in though, currently.

@JeffFessler
Copy link
Member

The lung regions in that QRM phantom look quite difficult to approximate analytically very accurately.
Would ellipsoids be close enough for your work?

@Dale-Black
Copy link
Author

Dale-Black commented Dec 29, 2022

Oh, I can move this over to discussions if that's helpful! An elliptical cylinder would likely approximate this phantom closely enough. Still, I am unsure if I could make the inner components (lung, vertebrae, etc.) as quickly as I initially expected. Do you have examples within the docs that would help walk me through a similar process? For example, I am not sure how to create an elliptical cylinder, to begin with. Any thoughts?

Also, I am simply displaying the image using CairoMakie.heatmap(img[:, :, a]) where a is @bind a PlutoUI.Slider(axes(img, 3))

@JeffFessler
Copy link
Member

Do you have examples within the docs that would help walk me through a similar process? For example, I am not sure how to create an elliptical cylinder, to begin with.

The docs show a Cylinder example (and it's actually an elliptical cylinder). My advice is to approximate everything by ellipsoids and elliptical cylinders, like the 3D Shepp Logan phantom. After all, a digital phantom is only a crude approximation of the real world anyway, so why bother coding a fancy vertebrae shape?
If you want more realistic voxelized phantoms, look at the XCAT phantom from Duke.

heatmap by default sadly does not preserve aspect ratio properly. You could try MIRTjim.jim instead.
https://jefffessler.github.io/MIRTjim.jl/stable/generated/examples/1-examples/#examples

yes, please move to discussions. I couldn't see how to do that on github and I'm not alone it seems:
community/community#2952

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants