This is a image slice viewer with built in scroll, contrast, zoom and ROI tools.
Updated 21 Jul 2017

View License

Use this class to make a self-contained image viewing panel within a GUI (or any figure). Similar to imtool but with the added ability to scroll through slices of an image stack. Only designed to view grayscale (intensity) images. Hopefully this will save people time when either designing a GUI or even when they just need to quickly look through an image stack.

Cite As

Justin Solomon (2024). imtool3D (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2016b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired: imtool3D_td, Brain Ruler

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes


Many bug fixes and improvements.

Added a "smart" paint brush. The brush works by doing a local binary Ostu threshold and then painting onto only the area that contains the most pixels. This lets you accurately capture the edge of a feature quickly.

Fixed a small bug related to windowing with the mouse.

Added a paint brush to adjust the overlay mask. The window and leveling should now work well for images for any dynamic range. Added a property (windowSpeed) that controls how quickly the window and level settings change with mouse movement.

Fixed typo.
Fixed one more window and level bug.

2.3.2- Squished a few bugs for older Matlab versions. Added method to set and get the transparency of the overlaid mask. Refined the panning and zooming.

Now the code makes sure the figure is centered when creating an imtool3D object in a new figure.

Added ability to overlay a semi-transparent mask on top of the image data. Also redesigned/simplified the ROI tools implementation.

Updated for compatibility with MATLAB R2014b. Also fixed a bug where an error was shown when a single slice image is viewed with imtool3D.

Updated to allow for multiple imtool3D objects in a single figure while being able to use the scroll wheel for each one.

Updated Screenshot

2.1- Added crop tool, help button, and button that resets the pan and zoom settings to show the entire image (useful when you're zoomed in and you just want to zoom out quickly.

New in version 2.0- Completely redesigned the tool. Window and leveling, pan, and zoom are now done with the mouse as is standard in most medical image viewers. Also the overall astestic design of the tool is improved with a new black theme. Added ab

Added the method:
ROI = getROIinfo(tool)
This lets the user get information about the currently selected ROI