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

Roi time series select colour change #402

Open
wants to merge 21 commits into
base: develop-main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
149e5fc
cleanup files
milesAraya Jan 6, 2025
34024da
Merge remote-tracking branch 'origin/feature/516' into feature/RoiTim…
sanglevinh Feb 10, 2025
f6b3669
add colour change
sanglevinh Feb 10, 2025
6cf67ff
Fix highlight
sanglevinh Feb 10, 2025
b9f62de
block click roi add not commit
sanglevinh Feb 11, 2025
9a0ccbd
reset roi click when commit roi
sanglevinh Feb 11, 2025
bf6dda7
Fix call api getTimeSeriesDataById when roi is temp add
sanglevinh Feb 11, 2025
5eebc2e
remove check
sanglevinh Feb 12, 2025
e12c1db
revert fix error call api
sanglevinh Feb 12, 2025
0f76477
Merge remote-tracking branch 'origin/feature/516' into feature/RoiTim…
sanglevinh Feb 18, 2025
f416ae4
Fix change colour
sanglevinh Feb 18, 2025
5f268ed
Merge remote-tracking branch 'origin/feature/516' into feature/RoiTim…
sanglevinh Feb 18, 2025
de83bea
fix roiAlpha
sanglevinh Feb 18, 2025
02546bb
Merge remote-tracking branch 'origin/feature/516' into feature/RoiTim…
sanglevinh Feb 19, 2025
f28ee6e
Reset all roi clicked when add, edit or delete roi
sanglevinh Feb 19, 2025
f1a3d2a
Merge remote-tracking branch 'origin/feature/516' into feature/RoiTim…
sanglevinh Feb 19, 2025
c31aae5
Add link all roi
sanglevinh Feb 19, 2025
4598adb
fix roiVisualSelected undefined
sanglevinh Feb 21, 2025
43fe89b
Add link fluorescence to cell roi visualize
sanglevinh Feb 25, 2025
fb92b12
Merge remote-tracking branch 'origin/develop-main' into feature/RoiTi…
sanglevinh Mar 3, 2025
36987b2
Fix drag select roi
sanglevinh Mar 6, 2025
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 @@ -59,7 +59,7 @@ export const AlgorithmOutputDialog = memo(function AlgorithmOutputDialog({
nodeId={nodeId}
/>
<DialogContent dividers sx={{ pt: 1, px: 2 }}>
<BoxFilterProvider>
<BoxFilterProvider nodeId={nodeId}>
{open && <OutputViewer nodeId={nodeId} />}
{open && dialogFilterNodeId ? <BoxFilter nodeId={nodeId} /> : null}
</BoxFilterProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,6 @@ const BoxFilter = ({ nodeId }: { nodeId: string }) => {
return { dim1: dim1?.filter(Boolean), roi: roi?.filter(Boolean) }
}, [filterParam])

useEffect(() => {
setFilterParam(filterSelector)
}, [filterSelector, setFilterParam])

const getData = useCallback(
(value?: TDim[]) =>
value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,61 @@ import {
PropsWithChildren,
SetStateAction,
useContext,
useEffect,
useMemo,
useState,
} from "react"
import { useSelector, useDispatch, shallowEqual } from "react-redux"

import { DialogContext } from "components/Workspace/FlowChart/Dialog/DialogContext"
import { selectAlgorithmDataFilterParam } from "store/slice/AlgorithmNode/AlgorithmNodeSelectors"
import { TDataFilterParam } from "store/slice/AlgorithmNode/AlgorithmNodeType"
import { getRoiData } from "store/slice/DisplayData/DisplayDataActions"
import { selectOutputFilePathCellRoi } from "store/slice/Pipeline/PipelineSelectors"
import { selectCurrentWorkspaceId } from "store/slice/Workspace/WorkspaceSelector"
import { AppDispatch } from "store/store"

const BoxFilterContext = createContext<{
filterParam?: TDataFilterParam
setFilterParam: Dispatch<SetStateAction<TDataFilterParam | undefined>>
setRoiPath: Dispatch<SetStateAction<string>>
roiPath: string
setFilterParam: Dispatch<SetStateAction<TDataFilterParam | undefined>>
}>({
filterParam: undefined,
setFilterParam: () => null,
roiPath: "",
setRoiPath: () => null,
})

export const useBoxFilter = () => useContext(BoxFilterContext)

export const BoxFilterProvider = ({ children }: PropsWithChildren) => {
const [filterParam, setFilterParam] = useState<TDataFilterParam>()
const [roiPath, setRoiPath] = useState<string>("")
export const BoxFilterProvider = ({
children,
nodeId,
}: PropsWithChildren<{ nodeId: string }>) => {
const filterSelector = useSelector(
selectAlgorithmDataFilterParam(nodeId),
shallowEqual,
)
const [filterParam, setFilterParam] = useState<TDataFilterParam | undefined>(
filterSelector,
)
const { isOutput } = useContext(DialogContext)
const dispatch = useDispatch<AppDispatch>()
const workspaceId = useSelector(selectCurrentWorkspaceId)
const isExistFilterRoi = useMemo(
() => filterParam?.roi?.length,
[filterParam?.roi?.length],
)
const path = useSelector(selectOutputFilePathCellRoi(nodeId))

useEffect(() => {
if (isOutput && path && isExistFilterRoi && workspaceId) {
dispatch(getRoiData({ workspaceId, path }))
}
}, [dispatch, path, isExistFilterRoi, isOutput, workspaceId])

return (
<BoxFilterContext.Provider
value={{ filterParam, setFilterParam, roiPath, setRoiPath }}
value={{ filterParam, setFilterParam, roiPath: path }}
>
{children}
</BoxFilterContext.Provider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import {
setTimeSeriesItemZeroLine,
setTimeSeriesItemDrawOrderList,
changeRangeUnit,
setClickedData,
} from "store/slice/VisualizeItem/VisualizeItemSlice"
import { AppDispatch } from "store/store"
import { arrayEqualityFn } from "utils/EqualityUtils"
Expand Down Expand Up @@ -290,6 +291,14 @@ const LegendSelect: FC = () => {
drawOrderList: newDrawOrderList,
}),
)
dispatch(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Behavior before Edit Roi is started
    • Flou selected before start of Edit Roi is not released after start of Edit Roi.
      -> The selection of ROI in Edit Roi and the selection of Flou do not match.
      -> When Flou is selected in this state, the ROI selection is canceled, which seems to be a reversed operation.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Bug
    • React error when Add Roi -> Commit -> Select the added ROI?

setClickedData({
itemId,
clickedDataId: event.target.checked ? index : null,
}),
),
// eslint-disable-next-line no-console
console.log("#############\n In TimeSeriesItemEditor.tsx, clickedDataId")

if (filePath !== null) {
dispatch(getTimeSeriesDataById({ path: filePath, index: index }))
Expand Down
Loading
Loading