Topp-Roots-Lab / 3d-root-crown-analysis-pipeline

A pipeline to process 3-D volumes (.raw) of maize root crowns. Also known as XRCAP.
3 stars 1 forks source link

Possibly over aggressive segmentation #26

Closed tparkerd closed 3 years ago

tparkerd commented 3 years ago

Describe the bug Many slices are missing from volume 2183 (found in 20200624ZmStd_CSU19_RPFT2_28).

To Reproduce Steps to reproduce the behavior:

  1. Run raw2img with default settings
  2. Run batch-segmentation with default settings
  3. Preview point cloud data (.obj)

Expected behavior It should not be removing these slices.

Screenshots Screenshot from 2021-01-08 12-53-31

Desktop (please complete the following information):

Additional context It looks like the threshold value selected is a little too aggressive and is omitting value. There is a screw present in this volume which might have affected the brightness of other slices.

tparkerd commented 3 years ago

Redoing the reconstruction with the efX-CT software does not affect this (gpflederer).

tparkerd commented 3 years ago

Evidence of the screw: preview-raw-top-down 2183_109um-projection-side 2183_109um-projection-top

tparkerd commented 3 years ago

I did a comparison of the volume:

A: Original RAW data, unaltered

2183_109um_v1 6 1

Likely due to the screw, the threshold value automatically selected by the default segmentation method (v1.6.1) of the pipeline removes a substantial number of slices.

B: Adjusted window/level, export 16-bit PNG slices (skipping raw2img)

2183_109um_adjusted-image-sequence_v1 6 1

Steps

  1. Open .raw in ImageJ (Little-endian, do not use virtual stack)
  2. Image > Adjust > Window/Level... Tweak values for level and window until the root material is clearly distinguishable from all other objects in the volume. For example, a decent pair of values for this volume appear to be (Level: 6383, Window: 401). Make sure to appraise the values for a decent number of slies.
  3. Apply window and level adjustment to all slices
  4. File > Save as... > Image Sequence... (Format: PNG)
  5. Create folder to store grayscale slices

Make sure that the slices are named after their containing folder. For example, if the grayscale image folder is called 2183_109um-adjusted, each PNG image in it should be named along the same lines such as: 2183_109um-adjusted_0000.png.

C: Doctored adjusted slices generated in option B

2183_109um_doctored-image-sequence_v1 6 1

Although I used the adjusted slices as the starting point for doctoring the volume, you can use the original grayscale slices produced by raw2img if large chunks of the volume had been omitted during segmentation.

  1. Run batch-segmentation on original grayscale images and identify problematic slices
  2. Open each corresponding grayscale slice and black out any pixels that appear to be non-root material
  3. Save image as PNG, non-interlaced, uncompressed
  4. Repeat for all problematic slices

You may have to repeat this multiple times, each time checking the binary images and point cloud data (.obj) for artifacts. Rinse and repeat.

Results

I'm not sure if you can get away with a quick adjustment (option B) and still have reasonable data. The results for each are attached, and a decent amount of the values for the traits are not unreasonable. The traits measured as features are even closer (comparing B to C) since Skeleton relies on a single component representation of the data instead of binary slices for traits.