diff --git a/frontend/tomography/src/components/workflows/sweepPipeline/SubmissionFormCOR.tsx b/frontend/tomography/src/components/workflows/sweepPipeline/SubmissionFormCOR.tsx index ac516ae..b524643 100644 --- a/frontend/tomography/src/components/workflows/sweepPipeline/SubmissionFormCOR.tsx +++ b/frontend/tomography/src/components/workflows/sweepPipeline/SubmissionFormCOR.tsx @@ -6,6 +6,9 @@ import { Snackbar, Stack, Typography, + FormGroup, + FormControlLabel, + Checkbox, useTheme, } from "@mui/material"; import { JSONObject } from "../../../types"; @@ -62,6 +65,9 @@ const SubmissionFormCOR = (props: { return (props.prepopulatedParameters as JSONObject) ?? ({} as JSONObject); }); + const [isNormalisationChecked, setIsNormalisationChecked] = + useState(true); + // Derived child slices const sweepValues = useMemo(() => { // keep empty-string while typing; numbers are coerced by AJV at submit @@ -154,22 +160,12 @@ const SubmissionFormCOR = (props: { } } - return [ + let pipeline = [ { method: method, module_path: module_path, parameters: updatedLoaderParams, }, - { - method: "normalize", - module_path: "tomopy.prep.normalize", - parameters: { cutoff: null, averaging: "mean" }, - }, - { - method: "minus_log", - module_path: "tomopy.prep.normalize", - parameters: {}, - }, { method: "recon", module_path: "tomopy.recon.algorithm", @@ -185,6 +181,25 @@ const SubmissionFormCOR = (props: { }, }, ]; + + const normalisationMethods = [ + { + method: "normalize", + module_path: "tomopy.prep.normalize", + parameters: { cutoff: null, averaging: "mean" }, + }, + { + method: "minus_log", + module_path: "tomopy.prep.normalize", + parameters: {}, + }, + ]; + + if (isNormalisationChecked) { + pipeline = [pipeline[0], ...normalisationMethods, pipeline[1]]; + } + + return pipeline; }; // ---- Submit handler (validate just before submit) ---- @@ -291,6 +306,24 @@ const SubmissionFormCOR = (props: { + Pipeline Configuration + + ) => { + setIsNormalisationChecked(e.target.checked); + }} + slotProps={{ + input: { "aria-label": "controlled" }, + }} + /> + } + label="Apply normalisation to raw data" + /> + + Parameter Sweep Configuration