-
Notifications
You must be signed in to change notification settings - Fork 0
Basic Processing Walkthrough
>> ImBat_BatchExtract; % Wrapper for all pre-processing. Contains ImBat_Start.m. run in parent directory of data folders ( i.e. contains: za20190530, za20190529, za20190528 )
>> ImBat_Start; % Wrapper for motion correction, and automated ROI extraction
>> ImBat_FTP_Process; % use FTP to load one folder at a time. Must set RAID address
>> c3d_BatchExtract; % batch extraction of c3d files (behavioral tracking)
Individual function reference
>> FS_AV_Parse_batch; % converting .mov files to tifs
Once the preprocessing is complete, all data will be contained in folder with the structure
[animal prefix][date of recording]
for example:
za190528
The standard data format follows:
za190528/ *.mov; *.track files
za190528/extracted/ *.[session folders]; *.track files % session is usually 'fly' or 'rest'
za190528/extracted/[session] .*tifs; .*mats
Next step is to unpack the c3d tracking file, which should be run in the parent directory ( i.e. contains: za20190530, za20190529, za20190528 )
>> c3d_BatchExtract; % this will run through each animal folder and extract tracking data
Now that the data has been extracted into .mat and .tif files, the next step is to motion correct, and extract regions of interest ( ROIs).
For a single data folder, run:
>> ImBat_Start; % To run for a single day, run this in the animal folder
Alternatively, to extract many data folders at once:
>> ImBat_BatchExtract; % runs ImBat_Start across directory of animal folders
This can be run multiple times- a new folder will be created with each extraction.
% example:
za190528/extracted/Zack_190528_fly-1_extraction/processed_2020_02_28__1010/
to aggregate data for specific animals, run the following in the parent folder that contains all processed folders:
[ROI_Data] = ImBat_MultiDayAnalysis([animal prefix]); % animal prefix could be: 'za'
This will create a folder called 'Processed' on your desktop, and will pull data from the most recent extraction for all [animal prefix] sessions in your current directory.
Next, Open the 'Processed' folder. Load in the following data:
% 1. ROI_Data
% 2. master_track_file
% 3. cell_registered_struct
% 4. aligned_data_struct
Next, check the quality of the extraction:
[Extraction_Metadata] = ImBat_PreCheck(ROI_Data);
Run the Following functions to aggregate data across days:
% Concatonate/Cluster data across days
[CombinedROI,ROI_Data] = ImBat_GroupCalcium(ROI_Data,cell_registered_struct,aligned_data_struct);
% repair bat flight data ( important for z bats with bad tracking) :
ROI_Data = ImBat_RepairFlightData(ROI_Data);
% now, we have a restricted set for ROI_Data, now cluster the flights:
flightPaths = ImBat_GroupFlights(ROI_Data,'mtf',master_track_file,'dist',1.2); % just the flights
Plot Max Projections across days:
% labeled dff projections:
days2use = 12:15; % days to use
cells2use = [123,125,105,113,46,100,146,109,139]; % ROIs to use
>> ImBat_PlotTrackedMasks(ROI_Data,CombinedROI,cell_registered_struct,days2use,cells2use);
Plot Stored Df/f Images:
>> ImBat_PlotStoredDff(ROI_Data)
Display Flight-Aligned ROI data:
% Align Flight data to the top 3 flight clusters:
for flight_cluster = 1:3;
[FlightAlignedROI{flight_cluster}] = ImBat_Align_FC(CombinedROI,flightPaths,flight_cluster+1);
end
% Plot ROIs aligned to Flights:
>> ImBat_PlotAlignedROIs(FlightAlignedROI{1},ROI_Data,);