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: Start using group filtering to define measurements table layout #4501

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

wayfarer3130
Copy link
Contributor

@wayfarer3130 wayfarer3130 commented Nov 14, 2024

Context

The measurements service already has a few groups of measurement types, it would be nice to have more groups of types and allow them to be listed in various ways in the measurements panel.

This PR is a start of how the grouping might work, which includes some changes in the core grouping code. However, it doesn't include any enhanced features yet.

Changes & Results

  • Add measurements filter option to getMeasurements and clearMeasurements
  • Move commands for measurements into a command module
  • Use the filtering for listing studies etc in the measurements panel
  • Added an "Untracked" measurements section
  • Fixed probe etc non-measurements to go into a separate section as designed

Testing

Checklist

PR

  • [] My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

  • [] My code has been well-documented (function documentation, inline comments,
    etc.)

Public Documentation Updates

  • [] The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • [] OS:
  • [] Node version:
  • [] Browser:

Copy link

netlify bot commented Nov 14, 2024

Deploy Preview for ohif-platform-docs ready!

Name Link
🔨 Latest commit 6744e23
🔍 Latest deploy log https://app.netlify.com/sites/ohif-platform-docs/deploys/67658eb5b033910008ea1a54
😎 Deploy Preview https://deploy-preview-4501--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.

Copy link

netlify bot commented Nov 14, 2024

Deploy Preview for ohif-dev ready!

Name Link
🔨 Latest commit 6744e23
🔍 Latest deploy log https://app.netlify.com/sites/ohif-dev/deploys/67658eb598b5760008075fe9
😎 Deploy Preview https://deploy-preview-4501--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.

Copy link

cypress bot commented Nov 14, 2024

Viewers    Run #4599

Run Properties:  status check passed Passed #4599  •  git commit 6744e23d82: Merge remote-tracking branch 'origin/master' into feat/measurements-service-filt...
Project Viewers
Branch Review feat/measurements-service-filtering
Run status status check passed Passed #4599
Run duration 02m 15s
Commit git commit 6744e23d82: Merge remote-tracking branch 'origin/master' into feat/measurements-service-filt...
Committer Bill Wallace
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 44
View all changes introduced in this branch ↗︎

@wayfarer3130 wayfarer3130 changed the title [WIP] feat: Start using group filtering to define measurements table layout feat: Start using group filtering to define measurements table layout Nov 20, 2024
@wayfarer3130 wayfarer3130 requested a review from sedghi November 20, 2024 13:25
<MeasurementTable.Body />
</MeasurementTable>
)}
{untrackedFindings.length > 0 && (
Copy link
Member

Choose a reason for hiding this comment

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

I think this might upset some people because we're imposing an untracked view on them. I was hoping people could choose what to see based on the filters they set through the customization service. Here, we simply loop over those filters and create the view, regardless of the number.

<MeasurementTable.Header>

</MeasurementTable.Header>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, that is what I wanted to have, I just wasn't quite there yet. Let me develop this a bit mroe and will pass it by you.

@wayfarer3130 wayfarer3130 requested a review from sedghi November 22, 2024 17:36
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.

Seems like the demo is opting in for untracked as well

CleanShot 2024-11-22 at 14 53 15@2x

in viewer.ohif.org we don't show temporary (untracked) can you make sure we don't break it? or at least if we are doing , we should separate them out since we can't create DICOM SR of the other orientations

@@ -169,7 +169,7 @@ export class CommandsManager {
* the commandOptions specified in the base.
*/
public run(
toRun: Command | Commands | Command[] | string | undefined,
toRun: Command | Commands | (Command | string)[] | string | undefined,
Copy link
Member

Choose a reason for hiding this comment

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

could we please update the docsring above and give example of what we can handle

something like

run ('updateMeasurement')
run (['updateMeasurement', 'displayWhatever'])
// other scnearios

@@ -81,7 +81,7 @@ const getPanelModule = ({ commandsManager, servicesManager, extensionManager }:
name: 'panelMeasurement',
iconName: 'tab-linear',
iconLabel: 'Measure',
label: 'Measurement',
label: 'All Measurements',
Copy link
Member

Choose a reason for hiding this comment

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

I think changing this might disrupt other people's tests if they're selecting based on the label. Can we leave this one unchanged?

Comment on lines +174 to 179
public getMeasurements(filter?: MeasurementFilter) {
if (filter) {
return [...this.measurements.values()].filter(measurement => filter.call(this, measurement));
}
return [...this.measurements.values()];
}
Copy link
Member

Choose a reason for hiding this comment

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

how about this

public getMeasurements(filter?: MeasurementFilter) {
return [...this.measurements.values()].filter(measurement => filter?.call(this, measurement) ?? true);
}

@@ -582,11 +588,15 @@ class MeasurementService extends PubSubService {
});
}

clearMeasurements() {
public clearMeasurements(filter?: MeasurementFilter) {
Copy link
Member

Choose a reason for hiding this comment

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

doc please, what is filter, and how it can be used

* the study and series.
*/
export function filterTracked(trackedStudy: string, trackedSeries) {
return measurement => {
Copy link
Member

Choose a reason for hiding this comment

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

does it matter tracked? can't it be filterByStudyAndSeries and still does the job?

* Filters for additional findings, that is, measurements with
* a value of type point, and having a referenced image
*/
export function filterAdditionalFinding(measurementService) {
Copy link
Member

Choose a reason for hiding this comment

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

filterAdditionalFindings? (s)


const { formatDate } = utils;

export function StudySummaryFromMetadata({ studyInstanceUID }) {
Copy link
Member

Choose a reason for hiding this comment

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

Can we use dcmjs style namings? so StudyInstanceUID for the prop? below you are actually doing const { StudyDate, StudyDescription } = instanceMeta;

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.

see my comments thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants