Giter Club home page Giter Club logo

Comments (5)

sweep-ai avatar sweep-ai commented on August 11, 2024

I'm sorry, but it looks like an error has occured. Try removing and re-adding the sweep label. I'll try again in a minute. If this error persists contact [email protected].


I'm a bot that handles simple bugs and feature requests but I might make mistakes. Please be kind!

from calcium-analysis.

sweep-ai avatar sweep-ai commented on August 11, 2024

I'm sorry, but it looks like an error has occured. Try removing and re-adding the sweep label. I'll try again in a minute. If this error persists contact [email protected].


I'm a bot that handles simple bugs and feature requests but I might make mistakes. Please be kind!

from calcium-analysis.

sweep-ai avatar sweep-ai commented on August 11, 2024

Hey @retroam,

I've started working on your request to create a GitHub workflow for running tests before merging. The plan is to set up a workflow that triggers on pull requests to the main branch. This workflow will set up a Python environment, install the necessary dependencies, and then run the tests located in the tests/ directory using both pytest and unittest frameworks.

Give me a minute!

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description.

function[I_t] = imagestostacks(image_fld,save_fld)
% IMAGESTOSTACKS(image_fld,save_fld) assembles tif images in image_fld as
% a single matrix which is then saved in save_fld as a .mat file
% NOTE: tif files in image_fld have to be labelled as image01...09,10 etc.
%Example:
% I = imagestostacks(image_fld,save_fld);
cd(image_fld);
i_bloc = dir('*.tif*');
I_t = [];
for j = 1:length(i_bloc)
info = imfinfo(i_bloc(j).name);
fileName{j} = i_bloc(j).name;
num_images = numel(info);
I_cum = zeros(info(1,1).Height,info(1,1).Width,num_images-1);%pre-alloc
disp(['Loading tif file ' num2str(j) ' of ' num2str(length(i_bloc))]);
for k = 1:num_images
I = imread(i_bloc(j).name, k, 'Info', info);
I_cum(:,:,k) = I;
end
close all force;
I_t = cat(3,I_cum,I_t);
clear I_cum;
end
save([save_fld '\I.mat'],'I_t');

import numpy as np
import scipy
import matcompat
image_fld = 'C:\Users\rka2p\Desktop\Calcium analysis\file_folder'
save_fld = 'C:\Users\rka2p\Desktop\Calcium analysis\save_folder'
imagestostacks(image_fld,save_fld)
#sd from mean of image intensity to set as threshold
sd = 7
[CC,I_mean,I_bw2,I_overlay] = stackstoroi(save_fld,sd)
imagesc(I_overlay)
axis off
[data,bkg] = roitodata(save_fld)

# Calcium-analysis
Python implementation of calcium imaging analysis pipeline for cardiac myocytes for [Automated image analysis of cardiac myocyte Ca2+ dynamics](https://pubmed.ncbi.nlm.nih.gov/22255377/)

function[CC,I_mean,I_bw2,I_overlay] = stackstoroi(save_fld,sd)
% STACKSTOROI(image_fld,sd) loads *I*.mat from save_fld for image
% segmentation. sd is how many standard deviations above the mean the
% threshold is set for segmentation. Outputs:
% CC: connected components found in I_bw2
% I_mean: averaged image of *I*.mat
% I_bw2: binary image containing image segementation of *I*.mat
% I_overlay: overlay of identified ROI over I_mean
%Example:
% [CC,I_mean,I_bw2,I_overlay] = stackstoroi(save_fld,sd);
cd(save_fld);
m_bloc = dir('*I*.mat*');
I_cum = [];
img_content = [];
if length(m_bloc)== 11
for i = 1:11
I_cum = cat(3,I_cum,importdata(m_bloc(i).name));
end
else
I_cum = importdata(m_bloc(1).name);
end
for j = 1:length(I_cum)
I = I_cum(:,:,j);
img_content(j) = mean(I(:));
end
[marks,locs] = findpeaks(img_content,'minpeakdistance',100);
I_mean = mean(I_cum(:,:,locs),3);
%I_bw1 = bwspecial(otsu(I_mean,3));
I_bw1 = threshold(I_mean,mode(I_mean(:))+ sd*mad(I_mean(:),1));
I_bw2 = bwareaopen(I_bw1,20,4);
CC = bwconncomp(I_bw2);
I_edge = edge(I_bw2);
I_overlay = I_mean;
I_overlay(I_edge) = 10*max(I_mean(:))/9;

def stackstoroi(save_fld, sd):
# Local Variables: I_bw2, I_cum, I_bw1, I, I_overlay, locs, CC, i,
# j, img_content, I_edge, m_bloc, I_mean, marks, save_fld, sd
# Function calls: save, stackstoroi, mad, findpeaks, cat, bwareaopen,
# length, edge, bwconncomp, importdata, max, threshold, mode, cd, dir, mean
#% STACKSTOROI(image_fld,sd) loads *I*.mat from save_fld for image
#% segmentation. sd is how many standard deviations above the mean the
#% threshold is set for segmentation. Outputs:
#% CC: connected components found in I_bw2
#% I_mean: averaged image of *I*.mat
#% I_bw2: binary image containing image segementation of *I*.mat
#% I_overlay: overlay of identified ROI over I_mean
#%Example:
#% [CC,I_mean,I_bw2,I_overlay] = stackstoroi(save_fld,sd);


I'm a bot that handles simple bugs and feature requests but I might make mistakes. Please be kind!

from calcium-analysis.

sweep-ai avatar sweep-ai commented on August 11, 2024

I'm sorry, but it looks like an error has occured. Try removing and re-adding the sweep label. I'll try again in a minute. If this error persists contact [email protected].


I'm a bot that handles simple bugs and feature requests but I might make mistakes. Please be kind!

from calcium-analysis.

sweep-ai avatar sweep-ai commented on August 11, 2024

Hey @retroam,

I've started working on setting up a GitHub Actions workflow for your repo. The plan is to create a workflow that gets triggered whenever a pull request is made. This workflow will set up the necessary Python environment, install the required dependencies, and run all the tests in the tests/ directory. If all tests pass, the pull request can be merged; if any test fails, the workflow will prevent the merge and provide feedback.

Give me a minute!

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description.

function[I_t] = imagestostacks(image_fld,save_fld)
% IMAGESTOSTACKS(image_fld,save_fld) assembles tif images in image_fld as
% a single matrix which is then saved in save_fld as a .mat file
% NOTE: tif files in image_fld have to be labelled as image01...09,10 etc.
%Example:
% I = imagestostacks(image_fld,save_fld);
cd(image_fld);
i_bloc = dir('*.tif*');
I_t = [];
for j = 1:length(i_bloc)
info = imfinfo(i_bloc(j).name);
fileName{j} = i_bloc(j).name;
num_images = numel(info);
I_cum = zeros(info(1,1).Height,info(1,1).Width,num_images-1);%pre-alloc
disp(['Loading tif file ' num2str(j) ' of ' num2str(length(i_bloc))]);
for k = 1:num_images
I = imread(i_bloc(j).name, k, 'Info', info);
I_cum(:,:,k) = I;
end
close all force;
I_t = cat(3,I_cum,I_t);
clear I_cum;
end
save([save_fld '\I.mat'],'I_t');

import numpy as np
import scipy
import matcompat
image_fld = 'C:\Users\rka2p\Desktop\Calcium analysis\file_folder'
save_fld = 'C:\Users\rka2p\Desktop\Calcium analysis\save_folder'
imagestostacks(image_fld,save_fld)
#sd from mean of image intensity to set as threshold
sd = 7
[CC,I_mean,I_bw2,I_overlay] = stackstoroi(save_fld,sd)
imagesc(I_overlay)
axis off
[data,bkg] = roitodata(save_fld)

# Calcium-analysis
Python implementation of calcium imaging analysis pipeline for cardiac myocytes for [Automated image analysis of cardiac myocyte Ca2+ dynamics](https://pubmed.ncbi.nlm.nih.gov/22255377/)

function[CC,I_mean,I_bw2,I_overlay] = stackstoroi(save_fld,sd)
% STACKSTOROI(image_fld,sd) loads *I*.mat from save_fld for image
% segmentation. sd is how many standard deviations above the mean the
% threshold is set for segmentation. Outputs:
% CC: connected components found in I_bw2
% I_mean: averaged image of *I*.mat
% I_bw2: binary image containing image segementation of *I*.mat
% I_overlay: overlay of identified ROI over I_mean
%Example:
% [CC,I_mean,I_bw2,I_overlay] = stackstoroi(save_fld,sd);
cd(save_fld);
m_bloc = dir('*I*.mat*');
I_cum = [];
img_content = [];
if length(m_bloc)== 11
for i = 1:11
I_cum = cat(3,I_cum,importdata(m_bloc(i).name));
end
else
I_cum = importdata(m_bloc(1).name);
end
for j = 1:length(I_cum)
I = I_cum(:,:,j);
img_content(j) = mean(I(:));
end
[marks,locs] = findpeaks(img_content,'minpeakdistance',100);
I_mean = mean(I_cum(:,:,locs),3);
%I_bw1 = bwspecial(otsu(I_mean,3));
I_bw1 = threshold(I_mean,mode(I_mean(:))+ sd*mad(I_mean(:),1));
I_bw2 = bwareaopen(I_bw1,20,4);
CC = bwconncomp(I_bw2);
I_edge = edge(I_bw2);
I_overlay = I_mean;
I_overlay(I_edge) = 10*max(I_mean(:))/9;

def stackstoroi(save_fld, sd):
# Local Variables: I_bw2, I_cum, I_bw1, I, I_overlay, locs, CC, i,
# j, img_content, I_edge, m_bloc, I_mean, marks, save_fld, sd
# Function calls: save, stackstoroi, mad, findpeaks, cat, bwareaopen,
# length, edge, bwconncomp, importdata, max, threshold, mode, cd, dir, mean
#% STACKSTOROI(image_fld,sd) loads *I*.mat from save_fld for image
#% segmentation. sd is how many standard deviations above the mean the
#% threshold is set for segmentation. Outputs:
#% CC: connected components found in I_bw2
#% I_mean: averaged image of *I*.mat
#% I_bw2: binary image containing image segementation of *I*.mat
#% I_overlay: overlay of identified ROI over I_mean
#%Example:
#% [CC,I_mean,I_bw2,I_overlay] = stackstoroi(save_fld,sd);


I'm a bot that handles simple bugs and feature requests but I might make mistakes. Please be kind!

from calcium-analysis.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.