MATLAB GUI#
Note
Interactive GUI - please run each section individually. DO NOT run the entire script at once.
initial_alignment#
For loading path and image information:
Path setup (first section): Users need to modify the paths to match their system
Image sizing: It’s recommended to resize images first: - 800 × 1140 pixels for coronal view - 1320 × 800 pixels for sagittal view
If using original size images, specify
use_already_downsampled_image=falseinslice_preprocessing.mand ensuremy_Resolutionis set correctly
slice_preprocessing#
Image preprocessing pipeline including:
Cropping and rotation
Contrast adjustment
Downsampling of histology images
slice_registration#
Slice registration to Allen Brain Atlas
Tip
Interactive Registration Workflow:
Setting transform points: Press
tin both slice and atlas viewer windows to label transformation points (minimum 10 points recommended)View results: Press
h+ato see the registration overlayLoad existing transforms: Press
lto load transformation matrix
After each image:
Press
dto delete all points in both windowsPress
hto leave overlay of current slice in atlas windowPress
→(right arrow) in slice window for next imagePress
↓(down arrow), then scroll to find corresponding atlas positionLabel new transformation points for the current image
Applying existing transformation matrices:
Copy the .mat transformation file to the appropriate directory
Press
lto load, thenxto save the transformed imageVerify result using
h+a
save_transform_mat#
Save the 3×3 transformation matrix for batch processing
analysis_rois#
Analyze pixel-wise ROI locations and extract spatial coordinates within the Allen Brain Atlas coordinate system