• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vanvalenlab / deepcell-label / 4578689396

pending completion
4578689396

Pull #436

github

GitHub
Merge ddb425c30 into 6a993cb7a
Pull Request #436: Model training overhaul: SNGP model, uncertainty visualization, and custom embedding support

462 of 1163 branches covered (39.72%)

Branch coverage included in aggregate %.

20 of 628 new or added lines in 27 files covered. (3.18%)

76 existing lines in 5 files now uncovered.

3248 of 5431 relevant lines covered (59.8%)

543.49 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/frontend/src/Project/EditControls/CellTypeControls/TrainingUI/LearnTab.js
1
import { Box, Button, MenuItem, TextField } from '@mui/material';
2
import Grid from '@mui/material/Grid';
3
import { useSelector } from '@xstate/react';
4
import { useState } from 'react';
5
import { useChannelExpression } from '../../../ProjectContext';
6
import AddRemoveCancel from '../ChannelExpressionUI/AddRemoveCancel';
7
import CalculateWholeToggle from '../ChannelExpressionUI/CalculateWholeToggle';
8
import EmbeddingColorMapToggle from './EmbeddingColorMapToggle';
9
import EmbeddingPlot from './EmbeddingPlot';
10
import TrainingButtons from './TrainingButtons';
11

12
function LearnTab() {
13
  const [embedding, setEmbedding] = useState(0);
×
14
  const channelExpression = useChannelExpression();
×
NEW
15
  const imported = useSelector(channelExpression, (state) => state.context.embeddings);
×
NEW
16
  const embeddingPlotted = useSelector(channelExpression, (state) => state.context.reduction);
×
NEW
17
  const quantities = imported
×
18
    ? ['Position', 'Mean', 'Total', 'Imported']
19
    : ['Position', 'Mean', 'Total'];
20

21
  const handleVisualize = () => {
×
22
    if (quantities[embedding] === 'Position') {
×
23
      channelExpression.send({ type: 'CALCULATE', stat: quantities[embedding] });
×
24
    } else {
25
      channelExpression.send({ type: 'CALCULATE_UMAP', stat: quantities[embedding], whole: true });
×
26
    }
27
  };
28

29
  return (
×
30
    <>
31
      <Grid item display='flex'>
32
        <TextField
33
          select
34
          size='small'
35
          value={embedding}
36
          label='Embedding'
37
          onChange={(evt) => setEmbedding(evt.target.value)}
×
38
          sx={{ width: '47%' }}
39
        >
40
          {quantities.map((opt, index) => (
41
            <MenuItem key={index} value={index}>
×
42
              {opt}
43
            </MenuItem>
44
          ))}
45
        </TextField>
46
        <Box sx={{ marginLeft: '1%' }}>
47
          <CalculateWholeToggle />
48
        </Box>
49
      </Grid>
50
      <Grid item>
51
        <Button sx={{ width: '97%' }} variant='contained' onClick={handleVisualize}>
52
          Visualize
53
        </Button>
54
      </Grid>
55
      <TrainingButtons />
56
      {embeddingPlotted ? (
×
57
        <>
58
          <EmbeddingColorMapToggle />
59
          <EmbeddingPlot embedding={embeddingPlotted} />
60
          <AddRemoveCancel />
61
        </>
62
      ) : null}
63
    </>
64
  );
65
}
66

67
export default LearnTab;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc