Macro_Select_ROI_for_Segmentation - stoeter/Fiji-Tools-for-HCS GitHub Wiki
- This macro is part of the "Fish_Embryo_Screen" macro set.
- This macro loads tiled Opera images (.tif, generated from Macro Opera Stack Montage for Fish) and enables the user to draw a ROI which is saved for further prosessing.
- Optionally objects can be counted manually and images can be annotated (saved in log file)
- Start the macro in Fiji under Plugins-> Fiji-Tools-for-HCS->Fish Embryo Screen->
- Macro Select ROI for Segmentation
- Select the folder of Opera images (.tif; usually Zmax folder)
- Select the folder for result ROIs (usually select same folder)
- Dialog “Conditions”
- Specify the image format (only tif images allowed, usually from previous macro for tiling Opera images).
- Adjust numbers of channels
- Define start well (macro can be terminated and later continued from that well number on)
-
Check if all found .tif should be shown in log file (helpful for filtering)
- Select the channel to use for drawing ROI
- Specify a tag/text that must be present in the file/path name of the files that will be opened
- Specify a tag/text that must be present in the file/path name of the files that will be opened
- Window ‘Array’ and a dialog “Action Required” will open
- Window ‘Array’ displays the files found
- If you are done with the file list, press ‘OK’ to go on or ‘Escape’ to stop macro
- File by file will be opened and the following options can be selected:
- Analyse image? If unchecked, next image will be opend
- Do manual counting? If checked an additional manual counting of objects will be enabled
- End script session? If checked the macro will be terminated normally (log file will be saved correctly)
- Polygon tool will be selected by default, but this can be changes by used
- Use zoom (+/-) and adjust brightness to display the image in the best way to draw ROI

- Draw ROI and close the ROI by double-click
- Multiple ROIs are possible by holding SHIFT
- Once ROI is drawn go on by clicking in window "Select region (ROI)..." OK button
-
The ROI is shown in the ROI Manager, but this window can be ignored
- Specific annotation that is written to log file: Fish is dead? Need re-imaging? Flag? as free-text annotation

- If "Do manual counting?" option is selected in "Analyse image?" window manual counting is enabled before drawing ROI
- Multi-point tool will be selected by default
- Use zoom (+/-) and adjust brightness to display the image in the best way to count objects

- Select as many objects by clicking in the image
- Selected objects and their number will be displayed
- Once ROI is drawn go on by clicking in window "Select all object manually..." OK button
- Window "..._points" will open with selected points on black image (could be used for merging or documentation)
- Object list is saved as a .txt file with the tag "...manualHSCcount.txt" (can be used for further analysis)
- The macro will continue with the drawing ROI mode (see above)
The macro produced the following outputs:
- .zip, ROIs with the tag "ROIset" that can be loaded with the macro Macro_Segment2D_in_ROI.ijm
- Log_*.txt, log file as text file with the processed images and manual annotations for each image (can be analysed further)
- .txt, manually counted object list with the tag "manualHSCcount" (optionally, can be processed further)
- All parameters set in the script and the files that are saved will be printed in log window and a log file (.txt) with time stamp will be saved in result folder
- no issues
The code you can find here.
- fifth release 07-04-2016: release with puplication of paper in JBS