Join/Login

Business Software

Open Source Software

For Vendors

Blog

About

More

Articles

Create

SourceForge Podcast

Site Documentation

Subscribe to our Newsletter

Support Request

For Vendors Help Create Join Login

Business Software

Open Source Software

SourceForge Podcast

Resources

Articles

Case Studies

Blog

Menu

Help

Create

Join

Login

Home

Browse

Iris

Calliope

Iris Calliope

2-photon scanning software

Brought to you by: heinmatt, kellgeor

Summary

Reviews

Support

Wiki

Tickets ▾

Bugs

Tasks

Feature Requests

SVN ▾

Iris Main

Auxiliary Code

Calliope

Discussion

Menu ▾ ▴

Browse Commits

Browse Files

[r1139]: / RoiQuest / +gfx / createContrastSelectionMenu.m  Maximize  Restore  History

Download this file

76 lines (67 with data), 2.8 kB

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75

function [cntst_blackHandle, cntst_whiteHandle] = createContrastSelectionMenu(~,~, position, defaultClims)

% createContrastSelectionMenu - Create UI for custom contrast selection.

%

% [cntst_blackHandle, cntst_whiteHandle] = createContrastSelectionMenu(~, ~, position, defaultClims)

% creates a UI interface for custom contrast selection

% using two sliders. The function creates a UIFigure with two sliders for

% adjusting the black and white levels of the contrast. The default contrast

% limits are specified by defaultClims.

%

% Parameters:

% - ~: Placeholder for unused callback parameters.

% - position: Position of the UI figure.

% - defaultClims: Default contrast limits [black, white].

%

% Returns:

% - cntst_blackHandle: Handle to the black slider.

% - cntst_whiteHandle: Handle to the white slider.

%

% Example:

% % Create UI for custom contrast selection

% [blackSlider, whiteSlider] = createContrastSelectionMenu([], [], [100, 100], [0.2, 0.8]);

%

% See also: uifigure, uislider, uilabel

%

% Author: Leonardo Lupori

% Date: 09.02.2024

% Create UIFigure and hide until all components are created

cntst_figHandle = uifigure(...

'Visible', 'off',...

'Color', [0.2, 0.2, 0.2],...

'Name','Custom Contrast',...

'Icon', '+gfx/contrast.png');

cntst_figHandle.Position = [position(1) position(2) 400 90];

% Create cntst_blackHandle

cntst_blackHandle = uislider(cntst_figHandle);

cntst_blackHandle.Limits = [0 1];

cntst_blackHandle.MajorTicks = [0, 0.2, 0.4, 0.6, 0.8, 1];

cntst_blackHandle.MinorTicks = [];

cntst_blackHandle.Position = [48 79 330 3];

cntst_blackHandle.Value = defaultClims(1);

cntst_blackHandle.FontColor = 'white';

cntst_blackHandle.Tag = 'blackSlider';

% Create The text label for the black Slider

BlackSliderLabel = uilabel(cntst_figHandle);

BlackSliderLabel.HorizontalAlignment = 'right';

BlackSliderLabel.Position = [2 69 35 22];

BlackSliderLabel.Text = 'Black';

BlackSliderLabel.FontColor = 'white';

BlackSliderLabel.FontSize = 14;

% Create cntst_whiteHandle

cntst_whiteHandle = uislider(cntst_figHandle);

cntst_whiteHandle.Limits = [0 1];

cntst_whiteHandle.MajorTicks = [0, 0.2, 0.4, 0.6, 0.8, 1];

cntst_whiteHandle.MinorTicks = [];

cntst_whiteHandle.Position = [48 36 330 3];

cntst_whiteHandle.Value = defaultClims(2);

cntst_whiteHandle.FontColor = 'white';

cntst_whiteHandle.Tag = 'whiteSlider';

% Create The text label for the white Slider

WhiteSliderLabel = uilabel(cntst_figHandle);

WhiteSliderLabel.HorizontalAlignment = 'right';

WhiteSliderLabel.Position = [2 26 36 22];

WhiteSliderLabel.Text = 'White';

WhiteSliderLabel.FontSize = 14;

WhiteSliderLabel.FontColor = 'white';

% Make the final figure visible

cntst_figHandle.Visible = 'on';

SourceForge

Create a Project

Open Source Software

Business Software

Top Downloaded Projects

Company

About

Team

SourceForge Headquarters
225 Broadway Suite 1600
San Diego, CA 92101
+1 (858) 422-6466

Resources

Support

Site Documentation

Site Status

SourceForge Reviews

© 2025 Slashdot Media. All Rights Reserved.

Terms Privacy Opt Out Advertise

×
Want the latest updates on software, tech news, and AI?

Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.

Submit