Standarize an image brightness relative to another image

Hi everyone! How do you standarize an image brightness relative to another image/images?

I was running into an issue while thresholding where the background for my images was different and throwing off what is considered signal or not. So my negative controls were coming up positive using the same threshold value as where other tissues signal was negative.

I have tried subtract background, but I need a way to standardize my images relative to each other as opposed to relative to itself. I hope that makes sense.

Thank you for the support!

The microscope I am using (NIKON Eclipse Ts2R Epifluorescence microscope) scales the background of the tissue based on the intensity of the signal, which has created a problem while I am quantifying. My negative control have no signal, but high background and I am unsure of how to accomodate that while I am quantifying. Therefore, while I am thresholding, my images are the software gives me false positive in majority of my tissues, while in others (such as Image 1 - Double Knockout CCN3) only high intensity signal is considered as threshold while everything else is not.

DKO%20NEGCRL%20GM|625x500

WT%20TRITC%20GM|625x500

1 Like

I think it would help to see some screenshots of the images in question in order to be able to help. Often such issues are quite difficult and tightly linked to the scientific question and the way the images were acquired; thus without more background information I don’t think one can give a general advise here.

1 Like

Generally speaking, images that have to be compared against one another for intensity purposes have to be normalized like for example in my python script, I do it on a directory of 3D images: http://Normalize Directory of XYZ/XYT images

The normalization function definitions are in Normalization Functions
It is in python, other option would be a java code using imglib2 which you can run in Eclipse IDE or other IDE of your choice:


static ImagePlus imp;
	public static void SaveImages(RandomAccessibleInterval<FloatType> noisy, File savedirectory, String savename ) {
		
		
	    imp = ImageJFunctions.show(noisy);

        FileSaver fsimp = new FileSaver(imp);
		
		fsimp.saveAsTiff(savedirectory + "/" + savename + ".tif");
		
		imp.close();
	}


public static void main(String args[]) throws ImgIOException {
		
		
	
		ImageJ ins = new ImageJ();
		
		
		//Open source image directory
		File SourceImages = new File(IJ.getDirectory("Choose Source Directory "));
		//Specify target image directory for saving the normalized images
		File TargetImages = new File(IJ.getDirectory("Choose Target Directory "));
		
		
		ImgOpener imgOpener = new ImgOpener();
		
		JFileChooser chooserImages = new JFileChooser();
		
		JFileChooser saveImages = new JFileChooser();
		
		
		
		chooserImages.setCurrentDirectory(SourceImages);
		saveImages.setCurrentDirectory(TargetImages);
		
		
		System.out.println("Files: " +  chooserImages.getCurrentDirectory().listFiles().length);
		
		File[] Images = chooserImages.getCurrentDirectory().listFiles();
		
		//Specify the min max values between which normalization has to be done
		FloatType min = new FloatType(0);
		FloatType max = new FloatType(1);
		
		for (int i = 0; i < Images.length; ++i) {
			
			if(!Images[i].getName().contains("._"))
			{
			System.out.println("Normalizing File Number" + i);
			
			
			
			
			File Image = Images[i];
			System.out.println(Image.getAbsolutePath());
			String imagename = Image.getName().replaceFirst("[.][^.]+$", "");
			String savename =  "Normalized" +  + imagename;
			RandomAccessibleInterval<FloatType> source = imgOpener.openImgs(Image.getAbsolutePath(), new FloatType())
					.get(0);
			Normalize.normalize(Views.iterable(source), min, max);
			
		
			SaveImages(source, TargetImages, savename);
			
		}
		}
       //Exit program after done saving
		System.out.println("Done saving files");
		System.exit(1);
		
	}

The microscope I am using (NIKON Eclipse Ts2R Epifluorescence microscope) scales the background of the tissue based on the intensity of the signal, which has created a problem while I am quantifying. My negative control have no signal, but high background and I am unsure of how to accomodate that while I am quantifying. Therefore, while I am thresholding, my images are the software gives me false positive in majority of my tissues, while in others (such as Image 1 - Double Knockout CCN3) only high intensity signal is considered as threshold while everything else is not.

!
DKO%20NEGCRL%20GM|625x500

WT%20TRITC%20GM|625x500

Maybe you can try to figure out how to change the microscope settings to disable this?

Other than that, I feel this is a case where a longer discussion would be needed, at least Skype, but probably even meeting in person would be necessary to really understand the project in all detail. Maybe others here feel different and can I give you online advise. Where are you based? Maybe there is an Bioimage Analyst nearby that you could consult?

Hi there,

I was wondering what does it exactly mean for your images to be in 3D?

If they are of the type XYZ or XYT, they are 3D. Channels I would treat separately.