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

feat(Thumbnail): Display set messages support & displaying of series inconsistencies in the thumbnail #3499

Merged
merged 29 commits into from
Aug 11, 2023

Conversation

rodrigobasilio2022
Copy link
Collaborator

@rodrigobasilio2022 rodrigobasilio2022 commented Jun 27, 2023

When the user has studies with series supposed to be reconstructable but they arent, at first its hard to identify them and know why a particular series cant be viewed in MPR mode. This PR proposes a warning button in thumbnail list that highlights problems in series and help users know geometry issues in the series. It is related to issue IDC #3360

Below I added some studies from the IDC database that has series with different problems

@netlify
Copy link

netlify bot commented Jun 27, 2023

Deploy Preview for ohif-dev ready!

Name Link
🔨 Latest commit
🔍 Latest deploy log https://app.netlify.com/sites/ohif-dev/deploys/64d651db54f36875d1ce5716
😎 Deploy Preview https://deploy-preview-3499--ohif-dev.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@netlify
Copy link

netlify bot commented Jun 27, 2023

Deploy Preview for ohif-platform-docs ready!

Name Link
🔨 Latest commit 39ef0e8
🔍 Latest deploy log https://app.netlify.com/sites/ohif-platform-docs/deploys/64d63f63e30f9d0008331064
😎 Deploy Preview https://deploy-preview-3499--ohif-platform-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@codecov
Copy link

codecov bot commented Jun 27, 2023

Codecov Report

Merging #3499 (39ef0e8) into master (8adf663) will not change coverage.
Report is 8 commits behind head on master.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3499   +/-   ##
=======================================
  Coverage   42.81%   42.81%           
=======================================
  Files          80       80           
  Lines        1448     1448           
  Branches      340      340           
=======================================
  Hits          620      620           
  Misses        663      663           
  Partials      165      165           
Files Changed Coverage Δ
...form/core/src/utils/isDisplaySetReconstructable.js 4.76% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9ae3d9f...39ef0e8. Read the comment docs.

@rodrigobasilio2022 rodrigobasilio2022 changed the title Feat/warning button WIP Feat/warning button Jun 28, 2023
Copy link
Contributor

@igoroctaviano igoroctaviano left a comment

Choose a reason for hiding this comment

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

Thanks for putting this together 🎖️
I left some comments/questions, let's discuss them later today.

extensions/default/src/validateInstances.js Outdated Show resolved Hide resolved
extensions/default/src/validateInstances.js Outdated Show resolved Hide resolved
extensions/default/src/validateInstances.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@jbocce jbocce left a comment

Choose a reason for hiding this comment

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

See my suggestions and comments.

platform/app/public/config/default.js Outdated Show resolved Hide resolved
platform/core/src/utils/formatPN.js Outdated Show resolved Hide resolved
platform/ui/src/components/Thumbnail/Thumbnail.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@igoroctaviano igoroctaviano left a comment

Choose a reason for hiding this comment

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

Reviewed. Left some comments.
👍

extensions/default/src/validateInstances.ts Outdated Show resolved Hide resolved
extensions/default/src/validateInstances.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@jbocce jbocce left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks so much.

@igoroctaviano
Copy link
Contributor

@sedghi @rodrigobasilio2022 It looks good to me except for one hiccup I found during my tests:

http://localhost:3000/viewer?StudyInstanceUIDs=1.3.6.1.4.1.14519.5.2.1.7009.2406.131628405171680429117301556825

If you try to see the last series (thumbnail) tooltip, it's cut in half, and if you try to scroll down to see you cant: Screen Recording 2023-08-09 at 09 15 06 (1)

@sedghi feel free to merge it although I'm still not happy with this flickering thing. I think we should refactor the whole left panel to avoid getting stuck with these UI limitations but this work should be done in a separate issue.

Copy link
Member

@sedghi sedghi left a comment

Choose a reason for hiding this comment

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

I feel like not merging now honestly.
First it was ok let's merge it although it should have appeared on the right side, now is it has weird behaviour when it is the last item. We don't know when the left panel is reworked maybe in 6 months, and I don't want to ship buggy feature.

@igoroctaviano
Copy link
Contributor

I feel like not merging now honestly. First it was ok let's merge it although it should have appeared on the right side, now is it has weird behaviour when it is the last item. We don't know when the left panel is reworked maybe in 6 months, and I don't want to ship buggy feature.

@sedghi I'll try to find a fix for this specific bug myself later today 👍 @rodrigobasilio2022 feel free to do the same.

@igoroctaviano
Copy link
Contributor

@sedghi I pushed a new tooltip that uses React portals to avoid these overflow issues. Can you please take a look?

@igoroctaviano igoroctaviano requested a review from sedghi August 10, 2023 14:26
/**
* A portal based tooltip.
*/
export default class ToolTip extends React.Component {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I sort of expected this to be named PortalTooltip to match the name of the file. I think I prefer it being named PortalTooltip but maybe I am being picky. Also note that the other/existing tool tip component is named Tooltip (i.e. small t for tip). We should be consistent one way or the other.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, i'll update it.

@fedorov
Copy link
Member

fedorov commented Aug 10, 2023

Why introducing this completely foreign to most users concept "Display set"? That thumbnail corresponds to a DICOM series, why not call it "DICOM series"?

const portalNodes = {};

/**
* A portal based tooltip.
Copy link
Collaborator

Choose a reason for hiding this comment

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

React portals sound cool - until now I did not know about them. Thanks for thinking of this. However I am bit surprised that we need to use the older style class type components. I did a quick search of the code base and noticed that this would be the first/only component that uses the old style - but I might be wrong. Are we actually forced to use this? I did see this https://react.dev/reference/react-dom/createPortal#rendering-to-a-different-part-of-the-dom, does it help so that we can use a function component instead?

Copy link
Contributor

@igoroctaviano igoroctaviano Aug 10, 2023

Choose a reason for hiding this comment

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

React portals sound cool - until now I did not know about them. Thanks for thinking of this. However I am bit surprised that we need to use the older style class type components. I did a quick search of the code base and noticed that this would be the first/only component that uses the old style - but I might be wrong. Are we actually forced to use this? I did see this https://react.dev/reference/react-dom/createPortal#rendering-to-a-different-part-of-the-dom, does it help so that we can use a function component instead?

I repurposed this component. It's not exposed and not worth going through the trouble of migrating it to function component. I added it just to workaround this specific issue, we should refactor the left panel so we can go back and use the original tooltip instead. Also, this is my last effort to address this specific issue without touching the left panel.

@igoroctaviano
Copy link
Contributor

igoroctaviano commented Aug 10, 2023

Why introducing this completely foreign to most users concept "Display set"? That thumbnail corresponds to a DICOM series, why not call it "DICOM series"?

@fedorov The concept of a display set has persisted since the first version of OHIF, this tooltip is tied to the display set messages which is part of the display set. I think this was done like that for consistency and also for extensibility once that messages could extend beyond just series.

@igoroctaviano igoroctaviano requested a review from jbocce August 10, 2023 19:02
Copy link
Contributor

@igoroctaviano igoroctaviano left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@sedghi sedghi left a comment

Choose a reason for hiding this comment

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

@igoroctaviano Can you please add comment on top of each PortalToolTip and PortalTooltipCard on where the code is being copied over? thanks

@igoroctaviano
Copy link
Contributor

@igoroctaviano Can you please add comment on top of each PortalToolTip and PortalTooltipCard on where the code is being copied over? thanks

Done, thanks.

Copy link
Collaborator

@jbocce jbocce left a comment

Choose a reason for hiding this comment

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

See my comments.

Copy link
Member

@sedghi sedghi left a comment

Choose a reason for hiding this comment

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

Looks great thanks for this.
Also thanks @igoroctaviano for adding the portal

@igoroctaviano igoroctaviano changed the title Feat/warning button feat(): display set messages / displaying of series inconsistencies in the thumbnail Aug 11, 2023
@igoroctaviano igoroctaviano changed the title feat(): display set messages / displaying of series inconsistencies in the thumbnail feat(Thumbnail): display set messages / displaying of series inconsistencies in the thumbnail Aug 11, 2023
@igoroctaviano igoroctaviano changed the title feat(Thumbnail): display set messages / displaying of series inconsistencies in the thumbnail feat(Thumbnail): Display set messages support & displaying of series inconsistencies in the thumbnail Aug 11, 2023
@igoroctaviano igoroctaviano merged commit 5302e5b into OHIF:master Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants