Cropping LLSM Images
by Eric WaitApr 17, 2020
Setup #
Dependencies #
MATLAB packages need to be on your path before the following will work. Place the following folders in your MATLAB directory:
+LLSM
+Utils
+ImUtils
+MicroscopeData
+HIP
+D3d
These files can all be found in the src/matlab
directories of the following repositories:
Rename Lattice Data to a Standard Format #
The package +MicroscopeData
expects a simplified naming convention.
Imaging metadata is moved from the filename into a json file.
This can all be accomplished by running the following:
timelapseDir = 'C:\lattice_data\20200101\Timelapse1_test'
LLSM.RenameKLBdirs(timelapseDir);
This will rename the klb files in the CPPdeconKLB
and deskewKLB
directories.
Cropping Images #
Modify Script Before Running #
Modify the first few line the attached document as follows:
-
rootDirectory
is the path to the klb directory you would like to crop. -
jsonFile
is the name of the json within therootDirectory
-
roiName
is the new name for the current crop.You can run this script multiple times to crop out separate regions of interest. Change
roiName
to something unique each time.
rootDirectory = 'D:\Images\LLSM\20190510\TimeLapse1_Pos1_Green464_CONVERT_1-100\CPPdeconKLB';
jsonFile = 'Pos1_decon.json';
roiName = 'Pos1_decon_roi1';
Save the script after modifiying and then run.
Running the script #
Many windows will open to allow you to select the region you are interested in.
The first window shows a temporal projection and allows you to select a region in X and Y. Click on the window creating points around the region you want. Once done, close the region by clicking on the first point. Then right click within the region and select make mask.
A second window will open showing a YZ projection. Perform a similar selection as the previous window. Only the Z dimension is calculated from this selection. After this window closes, it might take a while before the next opens.
The next window will be a 3D kymograph. Rotate the display by clicking and dragging in the 3D window. This will help you select the range of frames you would like to keep. Type the start and end frame in the provided dialog. Once the windows close, the regoin of interest will be saved.
Troubleshooting #
Send a screenshot and discription to ericwait@janelia.hhmi.org
Last modified Jul 16, 2020