Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
RR-N committed Aug 8, 2024
1 parent b47a923 commit c443dbc
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 13 deletions.
30 changes: 18 additions & 12 deletions +Methods/ChunkyMethods.m
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ function apply_colormap(app, actions, progress)
if exist('progress', 'var')
progress.Value = a/length(actions);
end


processed_vol = zeros(new_dims);
processed_vol = Methods.ChunkyMethods.apply_vol(app, actions{a}, processed_vol);
end

Expand Down Expand Up @@ -221,17 +222,18 @@ function spectral_unmix(app, ctx)

% Grab parent app & lock image processing tab.
channel = ctx.Source.Tag;
app.proc_lock('lock');
Program.GUIHandling.gui_lock(app, 'lock', 'processing_tab');

% Check if we've saved unmixing parameters. If not, initialize.
if ~exist('app.spectral_cache', 'var')
app.spectral_cache = struct('ch_db', [], 'ch_px', {}, 'ch_val', {}, 'bg_px', [], 'bg_val', [], 'blurred_img', []);
app.spectral_cache = struct('ch_db', [0], 'ch_px', {}, 'ch_val', {}, 'bg_px', [], 'bg_val', [], 'blurred_img', []);
end

% Grab channel indices.
ch_idx = [app.RDropDown.Value, app.GDropDown.Value, app.BDropDown.Value, app.WDropDown.Value];
ch_idx = [str2num(app.ProcRDropDown.Value), str2num(app.ProcGDropDown.Value), str2num(app.ProcBDropDown.Value)];

check = uiconfirm(app.UIFigure,sprintf('Click on the pixel on this slice that best represents %s.', channel),'Confirmation','Options',{'OK', 'Select different slice'},'DefaultOption','OK');
check = uiconfirm(app.CELL_ID,sprintf('Click on the pixel on this slice that best represents %s.', channel),'Confirmation','Options',{'OK', 'Select different slice'},'DefaultOption','OK');
image_data = app.proc_image.data(:, :, :, :);

switch check
case 'OK'
Expand All @@ -241,9 +243,9 @@ function spectral_unmix(app, ctx)

pixels = [pos(1), pos(2), round(app.proc_zSlider.Value)];

r = impixel(app.image_data(:,:,app.proc_zSlider.Value, ch_idx(1)), pos(1), pos(2));
g = impixel(app.image_data(:,:,app.proc_zSlider.Value, ch_idx(2)), pos(1), pos(2));
b = impixel(app.image_data(:,:,app.proc_zSlider.Value, ch_idx(3)), pos(1), pos(2));
r = impixel(image_data(:,:,app.proc_zSlider.Value, ch_idx(1)), pos(1), pos(2));
g = impixel(image_data(:,:,app.proc_zSlider.Value, ch_idx(2)), pos(1), pos(2));
b = impixel(image_data(:,:,app.proc_zSlider.Value, ch_idx(3)), pos(1), pos(2));

switch channel
case 'r'
Expand All @@ -265,22 +267,26 @@ function spectral_unmix(app, ctx)
% TBD
end

if ~ismember(channel, app.spectral_cache.ch_db)
app.spectral_cache.ch_db = [app.spectral_cache.ch_db, t_idx];
if app.spectral_cache.ch_db ~= [0]
if ~ismember(channel, app.spectral_cache.ch_db)
app.spectral_cache.ch_db = [app.spectral_cache.ch_db, t_idx];
end
else
app.spectral_cache.ch_db = [t_idx];
end

app.spectral_cache.ch_px{t_idx} = pixels;

case 'Select different slice'
app.proc_lock('unlock');
Program.GUIHandling.gui_lock(app, 'unlock', 'processing_tab');
return
end

% If necessary, grab background.
if ~isempty(app.spectral_cache.bg_px)
bg_pixels = app.spectral_cache.bg_px;
else
uiconfirm(app.UIFigure,'Click on the pixel on this slice that best represents background.','Confirmation','Options',{'OK'},'DefaultOption','OK');
uiconfirm(app.CELL_ID,'Click on the pixel on this slice that best represents background.','Confirmation','Options',{'OK'},'DefaultOption','OK');
color_roi = drawpoint(app.proc_xyAxes);
pos = round(color_roi.Position);
delete(color_roi);
Expand Down
Binary file removed +Wrapper/__pycache__/build_pdists.cpython-310.pyc
Binary file not shown.
Binary file removed +Wrapper/__pycache__/build_tree.cpython-310.pyc
Binary file not shown.
Binary file removed +Wrapper/__pycache__/getters.cpython-310.pyc
Binary file not shown.
Binary file removed +Wrapper/__pycache__/n_io.cpython-310.pyc
Binary file not shown.
Binary file removed +Wrapper/__pycache__/track_all.cpython-310.pyc
Binary file not shown.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,12 @@ External_Dependencies/matnwb/doc/matlabicon.gif
External_Dependencies/matnwb/doc/simulinkicon.gif
.idea/.name
*.pyc
*.pyc
*.toc
*.pyc
*.pyz
+Wrapper/build/main/warn-main.txt
*.html
+Wrapper/main.spec
.idea/.name
*.pkg
Binary file modified visualize_light.mlapp
Binary file not shown.
12 changes: 11 additions & 1 deletion win_visualize.prj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<deployment-project plugin="plugin.ezdeploy" plugin-version="1.0">
<configuration build-checksum="145520311" file="C:\Users\sep27\Documents\GitHub\NeuroPAL_ID\win_visualize.prj" location="C:\Users\sep27\Documents\GitHub\NeuroPAL_ID" name="win_visualize" preferred-package-location="C:\Users\sep27\Documents\GitHub\NeuroPAL_ID\win_visualize\for_redistribution" preferred-package-type="package.type.exe" target="target.ezdeploy.standalone" target-name="Application Compiler">
<configuration build-checksum="3362907317" file="C:\Users\sep27\Documents\GitHub\NeuroPAL_ID\win_visualize.prj" location="C:\Users\sep27\Documents\GitHub\NeuroPAL_ID" name="win_visualize" preferred-package-location="C:\Users\sep27\Documents\GitHub\NeuroPAL_ID\win_visualize\for_redistribution" preferred-package-type="package.type.exe" target="target.ezdeploy.standalone" target-name="Application Compiler">
<param.appname>NeuroPAL_ID</param.appname>
<param.icon>${PROJECT_ROOT}\win_visualize_resources\icon.ico</param.icon>
<param.icons>
Expand Down Expand Up @@ -117,6 +117,7 @@ Please add it to your desktop so you can easily find it.
<file>${PROJECT_ROOT}\Data\Documents\Instructions.pdf</file>
</fileset.package>
<fileset.depfun>
<file>C:\Users\sep27\AppData\Roaming\MathWorks\MATLAB Add-Ons\Collections\Microscopy Image Browser 2 (MIB2)\ImportExportTools\HDF5\xml2struct.m</file>
<file>C:\Users\sep27\AppData\Roaming\MathWorks\MATLAB Add-Ons\Collections\NeurodataWithoutBorders_matnwb(2)\+contrib\+blackrock\AddNEVFile.m</file>
<file>C:\Users\sep27\AppData\Roaming\MathWorks\MATLAB Add-Ons\Collections\NeurodataWithoutBorders_matnwb(2)\+contrib\+blackrock\AddNSFile.m</file>
<file>C:\Users\sep27\AppData\Roaming\MathWorks\MATLAB Add-Ons\Collections\NeurodataWithoutBorders_matnwb(2)\+contrib\+blackrock\get_channel_info.m</file>
Expand Down Expand Up @@ -744,8 +745,14 @@ Please add it to your desktop so you can easily find it.
<file>${PROJECT_ROOT}\+DataHandling\imreadND2.m</file>
<file>${PROJECT_ROOT}\+DataHandling\imreadVlab.m</file>
<file>${PROJECT_ROOT}\+DataHandling\NeuroPALImage.m</file>
<file>${PROJECT_ROOT}\+DataHandling\readAnnoH5.m</file>
<file>${PROJECT_ROOT}\+DataHandling\readStimFile.m</file>
<file>${PROJECT_ROOT}\+DataHandling\readTrackmate.m</file>
<file>${PROJECT_ROOT}\+DataHandling\writeNWB.m</file>
<file>${PROJECT_ROOT}\+DataHandling\writeTrackMate.m</file>
<file>${PROJECT_ROOT}\+Methods\AutoDetect.m</file>
<file>${PROJECT_ROOT}\+Methods\AutoId.m</file>
<file>${PROJECT_ROOT}\+Methods\ChunkyMethods.m</file>
<file>${PROJECT_ROOT}\+Methods\find_outlier.m</file>
<file>${PROJECT_ROOT}\+Methods\logsumexp.m</file>
<file>${PROJECT_ROOT}\+Methods\MatchHist.m</file>
Expand All @@ -762,10 +769,13 @@ Please add it to your desktop so you can easily find it.
<file>${PROJECT_ROOT}\+Neurons\NeuronBirth.m</file>
<file>${PROJECT_ROOT}\+Output\Illustration.m</file>
<file>${PROJECT_ROOT}\+Output\ImageAnalysis.m</file>
<file>${PROJECT_ROOT}\+Program\GUIHandling.m</file>
<file>${PROJECT_ROOT}\+Program\GUIPreferences.m</file>
<file>${PROJECT_ROOT}\+Program\ProgramInfo.m</file>
<file>${PROJECT_ROOT}\+Program\ProgramTests.m</file>
<file>${PROJECT_ROOT}\autoseg_window.mlapp</file>
<file>${PROJECT_ROOT}\channel_selector.mlapp</file>
<file>${PROJECT_ROOT}\Data\Images\loading.gif</file>
<file>${PROJECT_ROOT}\Data\Images\ZephIR_Logo.png</file>
<file>${PROJECT_ROOT}\Data\Models\avg_hist.mat</file>
<file>${PROJECT_ROOT}\Data\NeuroPAL\herm_data.mat</file>
Expand Down

0 comments on commit c443dbc

Please sign in to comment.