Allen CCF Code (Analysis of ROIs) Help

Hey all,
I am having trouble with the Allen CCF Code (https://github.com/cortex-lab/allenCCF). It basically maps and transforms brain slices to the idealized brain atlas. I was able to get through the pre-processing and the actual transformation portions of the code. However, I am having trouble with the Analyze.ROIs code. As inputs, it takes the outputs from the previous two codes and a csv file with my ROIs. However, I keep get an error.
The code:
%% SET FILE LOCATIONS OF TRANSFORM AND ROIS
% file location of transform and transformed image
transform_location = 'C:\Users\Au\Sakib\AllenCCF\output\processed\transformations\Composite (RGB) 3Channels Masked_processed_transform_data';
transformed_slice_location = 'C:\Users\Au\Sakib\AllenCCF\output\processed\transformations\Composite (RGB) 3Channels Masked_processed_transformed.tif';
% file location of ROIs (image / array of the same size as the reference ie 800 x 1140)
roi_location = 'C:\Users\Au\Sakib\AllenCCF\Mask of Composite ROI.tif';
% directory of reference atlas files
annotation_volume_location = 'C:\Users\Au\Sakib\AllenCCF\annotation_volume_10um_by_index.npy';
structure_tree_location = 'C:\Users\Au\Sakib\AllenCCF\structure_tree_safe_2017.csv';
% Synthetic ROIs for testing
% rois = zeros(800,1140,'uint8');
% rois(250:300, 600:610) = 200; rois(480:500, 200:210) = 200;
% imwrite(rois,roi_location)
%
% Using a set of x and y coordinates from the ImageJ function Analyze Particles to generate an ROI image
roi_array = zeros(800,1140,'uint8');
roi_array_values = csvread('C:\Users\Au\Sakib\AllenCCF\ROIcentersxy.csv', 1, 0);
y = roi_array_values(:, 2);
x = roi_array_values(:, 1);
%
for i = 1:length(roi_array_values)-1
roi_array(x(i),y(i)) = 200;
end
The Error:
>> Analyze_ROIs
Index in position 1 is invalid. Array indices must be positive integers or logical values.
Error in Analyze_ROIs (line 34)
roi_array(x(i),y(i)) = 200;
I am particularly confused about the roi_array(x(i),y(i)) = 200 specfically the =200 portion? How did the creator of the code get the number? Is it just arbitary or does it hold meaning? Thanks!!!

Answers (0)

Asked:

on 14 Jun 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!