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

What is the threshold? #36

Open
Kobe972 opened this issue Mar 22, 2022 · 6 comments
Open

What is the threshold? #36

Kobe972 opened this issue Mar 22, 2022 · 6 comments

Comments

@Kobe972
Copy link

Kobe972 commented Mar 22, 2022

Does the threshold equal to the CT value? For example, the thresholds of bones are [200., 800., 1300., 1500.], but the CT value of a bone is often less than 1000. If not, how to get the threshold given the range of the CT value?

@dave3d
Copy link
Owner

dave3d commented Mar 22, 2022

For CT bone it is using SimpleITK's DoubleThreshold filter:

https://simpleitk.org/doxygen/latest/html/classitk_1_1simple_1_1DoubleThresholdImageFilter.html

So the inner, narrow threshold (800-1300) is used as a starting point that is dilated but constrained to remain within the outer threshold (200-1500).

You can choose your own double threshold values yourself with the '--double' option. Of if you prefer the more traditional iso-value, you can use the '--isovalue' flag.

@Kobe972
Copy link
Author

Kobe972 commented Mar 22, 2022

For CT bone it is using SimpleITK's DoubleThreshold filter:

https://simpleitk.org/doxygen/latest/html/classitk_1_1simple_1_1DoubleThresholdImageFilter.html

So the inner, narrow threshold (800-1300) is used as a starting point that is dilated but constrained to remain within the outer threshold (200-1500).

You can choose your own double threshold values yourself with the '--double' option. Of if you prefer the more traditional iso-value, you can use the '--isovalue' flag.

There are two problems:

  • I read the url given above and I thought I have misunderstood something. I replaced [200., 800., 1300., 1500.] with [200., 800., 800., 1500.], and got the same result. But if I use BinaryThreshold and set the threshold as (200,1500), something extraneous are included. Why is that?
  • How to convert Hu range to your double threshold value?

@dave3d
Copy link
Owner

dave3d commented Mar 22, 2022

Yeah, using [200., 800., 1300., 1500.] would probably get you the same results as the default set. As far as the extraneous stuff when using BinaryThreshold, that's the nature of it. They came up with the DoubleThreshold algorithm to avoid the extraneous stuff that can arise.

The numbers I'm using are unitless. So if your image is CT with Hounsfield units, then that's what threshold values are. I chose those numbers just based on experimenting with some CT images in Hounsfield units that I had. They seemed to work well for me, and corresponded with the Hounsfield units I saw in the literature.

@Kobe972
Copy link
Author

Kobe972 commented Mar 23, 2022

Yeah, using [200., 800., 1300., 1500.] would probably get you the same results as the default set. As far as the extraneous stuff when using BinaryThreshold, that's the nature of it. They came up with the DoubleThreshold algorithm to avoid the extraneous stuff that can arise.

The numbers I'm using are unitless. So if your image is CT with Hounsfield units, then that's what threshold values are. I chose those numbers just based on experimenting with some CT images in Hounsfield units that I had. They seemed to work well for me, and corresponded with the Hounsfield units I saw in the literature.

  • Double thresholding means preserving data ranging from 200 to 1500 but exclude[830...1300]. For example,double thresholding [1,2,...,1600] will get [200,201,...,829,1301,...,1500], so if I change the thresholds to [200,800,800,1500] will get a different result(almost nothing excluded), which is contradictory to the fact.
  • You said "and corresponded with the Hounsfield units I saw in the literature", but I found they are not corresponding. For example, the Hu value of soft tissue is 30 to 50, but the double thresholds, i.e., [-15., 30., 58., 100.],which means -15<=Hu<(=)30 or 58<=Hu<(=)100 just blocked it.
  • So what each element stored in img is? The pixel?

@dave3d
Copy link
Owner

dave3d commented Mar 23, 2022

Here is the description of ITK's DoubleThreshold filter:

Double threshold uses the narrow threshold image as a marker image and the wide threshold image as a mask image in the geodesic dilation. Essentially, the marker image (narrow threshold) is dilated but constrained to lie within the mask image (wide threshold). Thus, only the objects of interest (those pixels that survived the narrow threshold) are extracted but the those objects appear in the final image as they would have if the wide threshold was used.

It seems that your understanding of double thresholding does not correspond with that.

You might try to implement your own segmentation approach using the variety of filters ITK/SimpleITK. Then once you have a binary segmentation image, you can pass that to my script, with an iso-value of 0.5, and extract out an STL surface of your segmentation.

@Kobe972
Copy link
Author

Kobe972 commented Mar 24, 2022

I've read the full document of DoubleThreshold but still misunderstanding. Could you please explain what the marker image and the mask image exactly means? For example, could you rewrite [20,800,1300,1500] in a sort of formal mathimatical manner? Normal threshold [20,1500] can be rewritten as 20<=x<=1500.

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

No branches or pull requests

2 participants