Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import {
Snackbar,
Stack,
Typography,
FormGroup,
FormControlLabel,
Checkbox,
useTheme,
} from "@mui/material";
import { JSONObject } from "../../../types";
Expand Down Expand Up @@ -62,6 +65,9 @@ const SubmissionFormCOR = (props: {
return (props.prepopulatedParameters as JSONObject) ?? ({} as JSONObject);
});

const [isNormalisationChecked, setIsNormalisationChecked] =
useState<boolean>(true);

// Derived child slices
const sweepValues = useMemo<SweepValues>(() => {
// keep empty-string while typing; numbers are coerced by AJV at submit
Expand Down Expand Up @@ -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",
Expand All @@ -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) ----
Expand Down Expand Up @@ -291,6 +306,24 @@ const SubmissionFormCOR = (props: {

<Divider />

<Typography variant="h6">Pipeline Configuration</Typography>
<FormGroup>
<FormControlLabel
control={
<Checkbox
checked={isNormalisationChecked}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
setIsNormalisationChecked(e.target.checked);
}}
slotProps={{
input: { "aria-label": "controlled" },
}}
/>
}
label="Apply normalisation to raw data"
/>
</FormGroup>

<Typography variant="h6">Parameter Sweep Configuration</Typography>
<ParameterSweepForm values={sweepValues} onChange={setSweepValues} />

Expand Down
Loading