Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Expansion Button for Non-Interleaved RGB #479

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Added

- Expansion button for non-interleaved RGB datasets that might be fluorescence.

### Changed

## 0.10.5
Expand Down
25 changes: 22 additions & 3 deletions avivator/src/components/Controller/Controller.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import Grid from '@material-ui/core/Grid';
import Tabs from '@material-ui/core/Tabs';
import Tab from '@material-ui/core/Tab';
import Divider from '@material-ui/core/Divider';
import UnfoldMoreIcon from '@material-ui/icons/UnfoldMore';
import Button from '@material-ui/core/Button';

import ChannelController from './components/ChannelController';
import Menu from './components/Menu';
Expand All @@ -25,7 +27,12 @@ import {
useImageSettingsStore,
useChannelSetters
} from '../../state';
import { guessRgb, useWindowSize, getSingleSelectionStats } from '../../utils';
import {
guessRgb,
useWindowSize,
getSingleSelectionStats,
isInterleaved
} from '../../utils';
import { GLOBAL_SLIDER_DIMENSION_FIELDS } from '../../constants';

function TabPanel(props) {
Expand Down Expand Up @@ -75,6 +82,7 @@ const Controller = () => {
isViewerLoading
} = useViewerStore();
const viewSize = useWindowSize();
const [areChannelsUnfolded, handleUnfoldChannels] = useState(false);
const isRgb = metadata && guessRgb(metadata);
const { shape, labels } = loader[0];
const globalControlLabels = labels.filter(label =>
Expand Down Expand Up @@ -168,11 +176,22 @@ const Controller = () => {
/>
)}
{!use3d && globalControllers}
{!isViewerLoading && !isRgb ? (
{!isViewerLoading && (!isRgb || areChannelsUnfolded) ? (
<Grid container>{channelControllers}</Grid>
) : (
<Grid container justify="center">
{!isRgb && <CircularProgress />}
{!isRgb ? (
<CircularProgress />
) : (
!isInterleaved(loader[0].shape) && (
<Button
onClick={() => handleUnfoldChannels(true)}
fullWidth
startIcon={<UnfoldMoreIcon />}
size="small"
/>
)
)}
</Grid>
)}
{!isRgb && <AddChannel />}
Expand Down