Skip to content
Merged
Show file tree
Hide file tree
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
16 changes: 9 additions & 7 deletions PanTS-Demo/src/components/OrganCheckbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ function Checked({
if (flag === false) setPartialToggled(false);
}, [checkState, OrganSystem, system, partialToggled, setPartialToggled]);
let color = null;
if (system === "Pancreas" || system === "Kidneys") {
color = MiscColorMap[system];
if (system in MiscColorMap) {
color = MiscColorMap[system as SubSystems];
color = `rgb(${color[0]}, ${color[1]}, ${color[2]})`
}

if (!OrganSystem[system] || level > 1) return null;
return (
<div className={`flex gap-2 flex-col ${level === 0 ? "" : "pl-3"}`}>
<div className={`flex gap-2 flex-col ${level === 0 ? "" : "pl-8"}`}>
<div className="flex justify-between items-center">
{!color ? (
<>
Expand Down Expand Up @@ -169,10 +169,12 @@ function Checked({
const rgb = color
? `rgb(${color[0]}, ${color[1]}, ${color[2]})`
: "gray";
if (organ == "pancreas") return null;
// A subgroup's header (Pancreas, Colon) already toggles the organ
// of the same name, so it isn't repeated as a child row.
if (level === 1 && organ === system.toLowerCase()) return null;
return (
<div className={`flex items-center gap-2 ${level == 0 ? "pl-8" : "pl-9"} `} key={idx}>
<div className="vp-organs__chevron" />
<div className={`flex items-center gap-2 ${level == 0 ? "pl-8" : "pl-5"} `} key={idx}>
<span aria-hidden="true" style={{ width: 18, height: 18, flexShrink: 0 }} />
<div
className={`text-white text-md rounded-md p-1 cursor-pointer hover:border-2 ${
!checkState[getOrganIdx(organ) + 1]
Expand Down Expand Up @@ -300,7 +302,7 @@ function OrganCheckbox({
: "gray";
return (
<div className="flex items-center gap-2 pl-8" key={organ.id}>
<div className="vp-organs__chevron" />
<span aria-hidden="true" style={{ width: 18, height: 18, flexShrink: 0 }} />
<div
className={`text-white text-md rounded-md p-1 cursor-pointer hover:border-2 ${
!checkState[organ.id] ? "border-0" : "border-2"
Expand Down
9 changes: 5 additions & 4 deletions PanTS-Demo/src/helpers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,14 @@ export const OrganSystemsArray: Systems[] = [

export const OrgansSubsystemsArray: SubSystems[] = [
"Kidneys",
"Pancreas"
"Pancreas",
"Colon"
]

export const MiscColorMap: MiscColorMapType = {
"Kidneys": [144, 238, 200],
"Pancreas": [244, 160, 160]
"Pancreas": [244, 160, 160],
"Colon": [238, 130, 238]
}

export const OrganSystems: OrganSystemsType = {
Expand Down Expand Up @@ -189,8 +191,7 @@ export const OrganSystems: OrganSystemsType = {
"pancreatic_lesion",
],
},
"colon",
"colon_lesion",
{ Colon: ["colon", "colon_lesion"] },
"duodenum",
"intestine",
"stomach",
Expand Down
2 changes: 1 addition & 1 deletion PanTS-Demo/src/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export type SegmentationAnnotations = {
};

export type Systems = "Vascular System" | "Lymphatic System" | "Reproductive System" | "Urinary System" | "Digestive System" | "Skeletal System" | "Respiratory System" | "Endocrine System";
export type SubSystems = "Pancreas" | "Kidneys"
export type SubSystems = "Pancreas" | "Kidneys" | "Colon"

export type AllSystems = Systems | SubSystems;

Expand Down
Loading