This worksheet is not assessed. Please work through it at your own pace. You may work on your own, with a partner or in a small group.
There are different sections in the worksheet:
Please donโt skip the Investigate sections and just rush through the Step-by-Step Instructions! The Investigate sections will help you to develop your own image analysis skills. Please ask if anything is unclear, you are unsure about the purpose of anything you are doing or you canโt work out how to do something.
โก๏ธ Download the Data folder (ZIP)
Download the data before continuing:
Step | Action | Details |
---|---|---|
1 | Open Fiji | Find the executable in the downloaded Fiji folder and double-click to launch it. |
2 | Open the Macro Recorder | Navigate to Plugins > Macro > Record . |
You may want to save the output of the Recorder are restart it at the end of each section.
In the previous worksheet, we used Analyze Particles
to identify and measure objects. There are more ways to make measurements in Fiji.
Step | Action | Details |
---|---|---|
1 | Open any image in Fiji | Navigate to File > Open and select a file or click and drag an image file into the Fiji toolbar or select an image from File > Open Samples... |
2 | Select the Line Selection tool | Click the Line Selection tool on the Fiji toolbar ![]() |
3 | Draw a line anywhere on the image | Click anywhere on the image, then move the mouse and click somewhere else on the image. You should see a yellow line stretch between the two points. |
4 | Plot the intensity profile along the line | Go to Analyze > Plot Profile |
A plot will appear with Grey Value on the y-axis and Distance on the x-axis. The Distance is the distance along the drawn line. The Grey Value is the intensity of the pixels along the line.
Step | Action | Details |
---|---|---|
1 | Select the Rectangle Selection tool | Click the Rectangle Selection tool on the Fiji toolbar ![]() |
2 | Draw a rectangle anywhere on the image | Click anywhere on the image, then move the mouse and click somewhere else on the image. You should see a yellow rectangle stretch between the two points. |
3 | Measure the properties of the rectangle | Go to Analyze > Measure or press the m key |
A Results window will appear with measurements made based on the rectangular selection. The measurements can be selected by changing the settings in Analyze > Set Measurements
(see the CountingAndMeasuringObjects worksheet for more details).
The ROI (region of interest) manager is used to store and measure selections.
Step | Action | Details |
---|---|---|
1 | Make a selection | Select any of the selection tools from the Fiji toolbar and click on the image to create a selection |
2 | Add the selection to the ROI manager | Press โtโ or go to `Edit > Selection > Add to Manager |
3 | Add some more selections | Repeat steps 1 and 2 |
4 | Measure all the selections | In the ROI manager window, click More > Multi-measure . Leave the default settings and click OK for the dialog box that appears. A results window will appear with measurements for each selection |
5 | Save the selections | In the ROI manager window, click More > Save... . Select the save location and name the file. Click Save. |
Measure
in the ROI manager rather than using multi-measure?Analyze Particles
can you use to add the regions detected using connected component analysis to the ROI manager?Uncredited images in this section are from Dave Masonโs image analysis course.
Increasing the spatial resolution when imaging almost always leads to a reduced field of view. A common areas for this are histology and astronomy. The image below is made up of 690 individual frames taken with the CEERS Near Infrared Camera (NIRCam). There are more details and high resolution images in the CEERS webpage.
On a microscope, this can be achieved with tile scanning (i.e. imaging multiple adjacent fields).
Stitching is the method used to put them back together again. Adjacent tiles can contain some overlap, this can improve the stitching results.
Things to remember when using Grid/Collection Stitching:
Most importantly, before you start you need to know your data:
Step | Action | Details |
---|---|---|
1 | Unzip Stitching_noOverlap.zip |
In your file browser, navigate to the downloaded Data folder. Find Stitching_noOverlap.zip and unzip it to a known location |
2 | Run the Stitching plugin | Run Plugins > Stitching > Grid/Collection Stitching |
3 | Select the stitching order to Column by Column and Up and right | Match the settings ![]() |
4 | Select the appropriate settings: Grid Size: 2x2 Tile Overlap: 0 Directory: {path to your folder} File Names: replace the numbers with {i} zero pad with more i - noOverlap_{iii}.tif Uncheck all the options except Add tiles as ROIs |
Match the settings below except for the Directory path. Set that to where you unzipped Stitching_noOverlap.zip ![]() |
5 | Run the stitching | Click OK and accept fast fusion if asked. |
Step | Action | Details |
---|---|---|
1 | Close all the additional windows | Click the window close buttons on all Fiji windows except the main toolbar and the macro recorder |
2 | Run the Stitching plugin | Run Plugins > Stitching > Grid/Collection Stitching |
3 | Use previous settings and add compute overlap |
Check the previous settings are still selected and additionally check the compute overlap option |
4 | Run the stitching | Click OK |
Step | Action | Details |
---|---|---|
1 | Unzip Stitching_Overlap.zip |
In your file browser, navigate to the downloaded Data folder. Find Stitching_Overlap.zip and unzip it to a known location |
2 | Run the Stitching plugin | Run Plugins > Stitching > Grid/Collection Stitching |
3 | Select the stitching order to Column by Column and Up and right | Match the settings ![]() |
4 | Use the previous settings except: Tile Overlap: 10% Directory: {path to your folder} File Names: replace the numbers with {i} zero pad with more i - Overlap_{iii}.tif Check Add tiles as ROIs |
Set the Tile Overlap to 10%. Change the directory path to where you unzipped Stitching_Overlap.zip . In File Names, remove the no before Overlap_{iii}.tif |
5 | Run the stitching | Click OK |
Batch processing allows the same processing to be run on multiple images. The built-in [Process > Batch] menu has lots of useful functions.
Unzip BBBC008_partial.zip
from the Data folder which contains a subset of data from BBBC008 from the Broad Bioimage Benchmark Collection to try it out.
Step | Action | Details |
---|---|---|
1 | Create an output folder | Create an empty folder on your desktop called Output |
2 | Open the batch converter | Go to Process > Batch > Convert... |
2 | Convert the tif files in BBBC008 to png files | . Click Input... and select the unzipped BBBC008 folder. Click Output... select the folder on the desktop. Select PNG from the Output format dropdown. Click Convert . |
Interpolation
methods?Step | Action | Details |
---|---|---|
1 | Create an output folder | Create an empty folder on your desktop called Output labelled |
2 | Open the batch macro processor | Go to Process > Batch > Macro... . |
3 | Select Input and Output folders | Click Input... and select the BBBC008 folder. Click Output... select the folder on the desktop. |
4 | Add the Label macro code |
Select Label from the Add macro code: drop down. |
5 | Create a string variable containing the title of the image | Above the drawString line in the macro box type title=getTitle(); |
6 | Replace the string in drawString with the title variable |
Replace "Hello" in drawString with title |
7 | Test the macro | Click the Test button |
Step | Action | Details |
---|---|---|
1 | Close the test image | Click the close button for the image window. If asked to save the image, click no |
2 | Convert the image to RGB | Click before setFont so the cursor is at the start of the macro. Select Convert to RGB from the Add macro code: drop down. |
3 | Test the macro | Click the Test button |
4 | If happy with the result, close the test image and run the macro | Click the close button for the image window. If asked to save the image, click no. Click Process in the Batch Process window. |
Try applying the skills you have learnt above and from the Counting and Measuring worksheet to batch process the BBBC008:
Use the Fiji toolbar search and the macro recorder Plugins > Macros > Record
to find out how to write the different commands needed. Test each part of the macro separately before trying to combine them. Use batch processing to apply the macro to all the images. You can use the Script Editor to write the macro if you prefer and then either save it and open in the Batch Process window or copy and paste it into the window.
Process
? If so, ask for help to fix the errors.There are more ways to do Batch processing in Fiji other than Process > Batch > Macro...
You can also:
Process > Batch > Macro...
but run it from a macro command (use the recorder to find out how)Templates > ImageJ 1.x > Batch > Process Folder (IJ1 Macro)
and use the template to process all the files in a folderProcess Folder (IJ1 Macro)
template, can you work out what it does? Please ask if you are unsure.getDir
?setBatchMode
in a macro?If you havenโt already, remember to save your the output from the Macro Recorder so you have a record of what you have done.
vevox.app Session ID: 107-492-073