Fix Images

Notebook name: fix_images.ipynb


This notebook allows you to fix a set of images by replacing all the pixels having the same value, by another value. For example, you can replace all the Inf values by 0 or np.NaN.

Here is the list of things you can fix:

  • Inf values
  • NaN values
  • Negative values

and here is the list of things you can replace with:

  • np.NaN
  • 0

Select your IPTS

Need help using the [IPTS selector](/tutorial/notebooks/select_ipts/#activate-search)?

Select your images

Using the files selection tool, select the images you want to fix.

Give statistics

In order to get an idea of what you need to correct, the next cell will display the following informations.

  • name of the file
  • total number of pixels in the image
  • number and percentage of pixels with negative values
  • number and percentage of pixels with infinite (negative or positive) values
  • number and percentage of pixels with non defined (NaN) values

A slider allows you to check those parameters for each of the images you loaded.

Display images and histograms

This is where you are able to visualize the corrections you are about to apply to the data. You can select which corrections you want to apply and see the effect on the image and its histogram.

You can make the following corrections

  • Negative values -> np.NaN or 0
  • Infinite values -> np.NaN or 0
  • NaN values -> np.NaN or 0

where np.NaN is the numpy NaN.

You can slide through the images to display

  • the raw image (top left corner)
  • the raw histogram (top right corner)
  • the new corrected image (bottom left corner)
  • the new histogram (bottom right corner)

Export images

Using the folder selection tool to select the output location of all the images corrected.