Skip to content

Image Shuffling

Back to MIB | User interface | Ribbon | Home


Overview

The Image Shuffling tool in Microscopy Image Browser (MIB) shuffles files for blind modeling or classification, ensuring users don't know which file corresponds to which condition. Models from shuffled files can later be restored to their original filenames for analysis.

Image Shuffling workflow overview Image Shuffling Workflow

Demonstration

Shuffle Images

Shuffle images dialog

This mode renames and shuffles files from input directories into multiple output subdirectories.

Prerequisites
  • Files for each condition must be in separate folders.
  • Images in each folder must have the same width and height.
  • Recommended: Each file contains a single image (no stacking).
  • For models, masks, or annotations: Only one file per type per directory (e.g., one *.model, *.mask, or *.ann file).
  • For models: All model files must contain the same materials.

Setup

Copy images from different conditions into separate directories (e.g., Control for control images, another folder for treatment images). There may be multiple conditions processed at the same time. The only requirement is to have separate conditions in their own directory.

Settings

  • Add folders: populate the list of input directories with images from different conditions.
  • Remove folders: remove a selected directory from the list.
  • : shuffle existing models (one *.model file per folder).
  • : shuffle existing masks (one *.mask file per folder).
  • : shuffle existing annotations (one *.ann file per folder).
  • : shuffle existing measurements (one *.measure file per folder).
  • Random seed: a positive number setting the random number generator seed; same value ensures consistent shuffling.
  • Filename extension: specify the extension for image filenames (e.g., TIF).
  • Filename template: define the naming pattern for shuffled images.
  • Output directory: set the destination directory for shuffled files. Use ... to browse.
  • Number of output sub-directories: number of subdirectories (e.g., Subset_001, Subset_002) to create under the output directory.
  • : in addition to the automatically generated .mibShuffle MATLAB-compatible file with shuffling details, generate an Excel sheet where the shuffling order is stored in human-readable format.
  • Rename and Shuffle: start the shuffling process. An automatically generated .mibShuffle MATLAB-compatible file with sorting details is saved to the output directory.

Restore Order

Restore order dialog

This mode restores shuffled models and masks to match their original image filenames.

Prerequisites
  • Images in each folder must have the same width and height.
  • For models, masks, or annotations: only one file per type per directory.

Steps

  • Press ... to select the project file (Project file (*.mibShuffle)), saved in the original shuffle output directory.
  • The Directories with shuffled images and Destination directories lists populate automatically.

Additional options to correct directories

  • Right-click on any directory entry for a context menu with options to:
    • Update directory: manually set a new path for the selected entry
    • Update parent folder for selected directories: remap all selected entries under a new parent folder
    • Copy path to clipboard: copy the directory path
    • Open directory in file explorer: browse the directory in Windows Explorer
  • Optionally, save updated directory settings with Save as.
  • Select which layer types to restore: , , , .
  • Press Restore shuffled to start.

Output

  • Restored models: Labels_RestoreRand_YYMMDD.model (e.g., Labels_RestoreRand_250405.model for April 5, 2025).
  • Restored masks: Mask_RestoreRand_YYMMDD.mask.
  • YYMMDD reflects the restoration date.

Usage Tips

Shuffling for Blind Analysis

To anonymize files:

  1. Organize conditions into separate folders (e.g., Control, Treatment).
  2. Set Number of output sub-directories (e.g., 3 for Subset_001 to Subset_003).
  3. Shuffle with a consistent Random seed.

Back to MIB | User interface | Ribbon | Home