Project-MONAI / Project-MONAI/MONAI

Support for multiple 2D images in a single tag for TensorBoardImageHandler/plot_2d_or_3d_image

Open
#7,724 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8.7k
Forks
1.6k
Avg merge
5d 1h
Merged PRs (30d)
20

Description

Is your feature request related to a problem? Please describe.
When using the TensorBoardImageHandler and passing a series of 2D images to the transforms, the plot_2d_or_3d_image plots each 2D image under a separate tag. When I do the same thing with a series of 3D images, they are plotted as multiple cards in the same tag.

Describe the solution you'd like
It would be really nice if both series of 2D images and series of 3D images behaved the same way. Plotting the series under a single tag is great as it reduces the number of tags in my TensorBoard.

I know that with a series of 3D images, the add_animated_gif function is called. Which plots using writer._get_file_writer().add_summary() for each image. However, the 2D images are plotted using writer.add_image() for each image. I tried figuring out why this happens and couldn't figure it out.

Describe alternatives you've considered
At the moment I just attach another dimension to the front of my 2D images so that they are plotted as 3D GIFs.

Additional context
Here's an example of default series of 2D images behavior:
image

Here's an example of default series of 3D images behavior:
image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read monai/visualize/img2tensorboard.py, especially plot_2d_or_3d_image and add_animated_gif, then inspect monai/handlers/tensorboard_handlers.py for TensorBoardImageHandler usage. The change is complete when a series of 2D images is written under one TensorBoard tag with multiple cards, matching the existing 3D-image behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.