From 4b137c3d5116eb98be328822590100614b655ed7 Mon Sep 17 00:00:00 2001 From: Aleksandr Gorodetskii <41908792+AleksandrGorodetskii@users.noreply.github.com> Date: Mon, 4 Nov 2024 19:51:02 +0300 Subject: [PATCH] GUI HCS Viewer: view settings (#3757) --- .../components/special/hcs-image/hcs-image.js | 112 +++++++++++------- .../hcs-z-position-selector/index.js | 2 + .../hcs-image/utilities/hcs-image-info.js | 21 +++- 3 files changed, 88 insertions(+), 47 deletions(-) diff --git a/client/src/components/special/hcs-image/hcs-image.js b/client/src/components/special/hcs-image/hcs-image.js index 77abb73507..0f3c13c28a 100644 --- a/client/src/components/special/hcs-image/hcs-image.js +++ b/client/src/components/special/hcs-image/hcs-image.js @@ -117,6 +117,17 @@ class HcsImage extends React.PureComponent { return (this.hcsInfo.sequences || []).map(s => s); } + @computed + get viewSettings () { + return this.hcsInfo?.viewSettings || { + video: true, + analysis: true, + plate: true, + well: true, + timeseries: true + }; + } + get selectedSequences () { const {selectedSequenceTimePoints = []} = this.state; const selectedSequencesIds = [ @@ -731,7 +742,9 @@ class HcsImage extends React.PureComponent { ) { return null; } - const analysisAvailable = this.hcsAnalysis && this.hcsAnalysis.available; + const analysisAvailable = this.hcsAnalysis && + this.hcsAnalysis.available && + this.viewSettings.analysis; const selectedImage = this.selectedWellFields[0]; if (!showConfiguration) { return ( @@ -749,14 +762,16 @@ class HcsImage extends React.PureComponent { ) } - 1) || - (selectedImage && selectedImage.depth > 1) - } - /> + {this.viewSettings.video ? ( + 1) || + (selectedImage && selectedImage.depth > 1) + } + /> + ) : null} - - - + {viewSettings.plate ? ( + + ) : null} + {viewSettings.well ? ( + + ) : null} + {viewSettings.timeseries ? ( + + ) : null} ); diff --git a/client/src/components/special/hcs-image/hcs-z-position-selector/index.js b/client/src/components/special/hcs-image/hcs-z-position-selector/index.js index ff0b0624b1..dbf2d7a7d5 100644 --- a/client/src/components/special/hcs-image/hcs-z-position-selector/index.js +++ b/client/src/components/special/hcs-image/hcs-z-position-selector/index.js @@ -49,6 +49,7 @@ function buildZPositionsArray (max, zSize, zUnit) { function HcsZPositionSelector (props) { const { className, + style, image, selection: rawSelection = [0], onChange, @@ -107,6 +108,7 @@ function HcsZPositionSelector (props) { className, styles.container )} + style={style} >