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

Difficulty Comparing Label Map and Intensity Image #659

Open
tbirdso opened this issue May 22, 2023 · 0 comments
Open

Difficulty Comparing Label Map and Intensity Image #659

tbirdso opened this issue May 22, 2023 · 0 comments

Comments

@tbirdso
Copy link

tbirdso commented May 22, 2023

Overview

I am seeing issues comparing a label image to an intensity image in correspondence.

Details

A few things seem to be happening:

  1. Positional arguments: difficult to tell which image should be listed first, how order affects underlying logic
  2. Initial view: One image initially appears in the scene, but is replaced rather than overlaid when the second image loads
  3. Comparison tabs: Both "Fixed" and "Moving" titles shown in UI, but no tabs initially appear to indicate that multiple channels are present
  4. Transfer function range: min and max transfer function scales are locked at range of second positional image argument, if values in first image lie out side the range the control points cannot be updated to include those values
  5. Double clicking a comparison option such as cyan-magneta overlay makes channel tabs 1 and 2 appear, but clicking on the second tab makes UI overlay disappear and produces the following console error:
bootstrapUIMachineOptions.js.es.js:5383 TypeError: Cannot read properties of undefined (reading '1')
    at ColorRangeInput (bootstrapUIMachineOptions.js.es.js:16481:37)
    at Ch (bootstrapUIMachineOptions.js.es.js:4256:7)
    at li (bootstrapUIMachineOptions.js.es.js:4719:7)
    at ck (bootstrapUIMachineOptions.js.es.js:6822:93)
    at bk (bootstrapUIMachineOptions.js.es.js:6301:12)
    at ak (bootstrapUIMachineOptions.js.es.js:6294:5)
    at Tj (bootstrapUIMachineOptions.js.es.js:6277:7)
    at Lj (bootstrapUIMachineOptions.js.es.js:6045:24)
    at bootstrapUIMachineOptions.js.es.js:3507:17
    at exports.unstable_runWithPriority (bootstrapUIMachineOptions.js.es.js:1209:14)

Minimum Reproducible Example

The following creates one "intensity" image with values on the range [127, 255] and one "label" image with values [0,1] and attempts to compare them in the scene:

arr = np.zeros([25,25,25], dtype=np.uint8)
arr[0:5,0:5,0:5] = 1
tmp_label_image = itk.image_view_from_array(arr)

arr2 = np.random.rand(25,25,25) * 128 + 127
tmp_intensity_image = itk.image_view_from_array(arr2.astype(np.float32))

itkwidgets.compare_images(tmp_label_image, tmp_intensity_image)

Versions

itkwidgets==1.0a33
itk==v5.3.0
Python 3.8, JupyterLab 3.0.9 (CodeOcean environment)
Google Chrome browser

cc @PaulHax

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

1 participant