Skip to content

Display series specified by URL parameters in viewer - #2979

Merged
sedghi merged 10 commits into
OHIF:v3-stablefrom
TFRadicalImaging:feat/add-series-instance-uid-query-parameter-to-ohif-core
Oct 25, 2022
Merged

Display series specified by URL parameters in viewer#2979
sedghi merged 10 commits into
OHIF:v3-stablefrom
TFRadicalImaging:feat/add-series-instance-uid-query-parameter-to-ohif-core

Conversation

@wayfarer3130

Copy link
Copy Markdown
Contributor

Display the series specified by the URL parameter seriesInstanceUID, and potentially other series parameters.

@netlify

netlify Bot commented Oct 14, 2022

Copy link
Copy Markdown

Deploy Preview for ohif-platform-docs canceled.

Name Link
🔨 Latest commit 8e22794
🔍 Latest deploy log https://app.netlify.com/sites/ohif-platform-docs/deploys/6357e2a4a18792000c474a6e


// const wadoDicomWebClient = new api.DICOMwebClient(wadoConfig);
const wadoDicomWebClient = staticWado
? new StaticWadoClient(wadoConfig)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just always create the StaticWadoClient, as it falls back to the base client if not required.

@netlify

netlify Bot commented Oct 14, 2022

Copy link
Copy Markdown

Deploy Preview for ohif-platform-viewer ready!

Name Link
🔨 Latest commit 8e22794
🔍 Latest deploy log https://app.netlify.com/sites/ohif-platform-viewer/deploys/6357e2a44f0739000919c757
😎 Deploy Preview https://deploy-preview-2979--ohif-platform-viewer.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 settings.

Comment thread package.json Outdated
"build": "lerna run build:viewer --stream",
"build:dev": "lerna run build:dev --stream",
"build:ci": "lerna run build:viewer:ci --stream",
"build:static": "lerna run build:static --stream && cp -rf ./platform/viewer/dist/* ~/ohif/.",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Don't want to include this line - suggest you run:
set APP_CONFIG=config/local_static.js
yarn start
which will automatically rebuild

wadoUriRoot: 'http://localhost:5000/dicomweb',
qidoRoot: 'http://localhost:5000/dicomweb',
wadoRoot: 'http://localhost:5000/dicomweb',
wadoUriRoot: 'http://localhost:5001/dicomweb',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Definitely don't commit this

*/
function defaultRouteInit(
{ servicesManager, studyInstanceUIDs, dataSource },
{ servicesManager, studyInstanceUIDs, dataSource, seriesInstanceUID },

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Grab the filters here direct, as there might be more than just seriesInstanceUID

@codecov

codecov Bot commented Oct 14, 2022

Copy link
Copy Markdown

Codecov Report

Merging #2979 (8e22794) into v3-stable (9f1e813) will increase coverage by 12.35%.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff               @@
##           v3-stable    #2979       +/-   ##
==============================================
+ Coverage      25.15%   37.51%   +12.35%     
==============================================
  Files            119      101       -18     
  Lines           2862     2154      -708     
  Branches         555      440      -115     
==============================================
+ Hits             720      808       +88     
+ Misses          1856     1103      -753     
+ Partials         286      243       -43     
Impacted Files Coverage Δ
...tform/core/src/services/CineService/CineService.js 12.50% <0.00%> (-6.25%) ⬇️
.../services/MeasurementService/MeasurementService.js 47.23% <0.00%> (-1.96%) ⬇️
platform/core/src/classes/CommandsManager.js 90.69% <0.00%> (-1.14%) ⬇️
platform/core/src/classes/MetadataProvider.js 4.54% <0.00%> (-0.72%) ⬇️
...core/src/services/ToolBarService/ToolBarService.js 1.36% <0.00%> (-0.13%) ⬇️
platform/viewer/src/index.js 0.00% <0.00%> (ø)
platform/viewer/src/appInit.js 0.00% <0.00%> (ø)
platform/core/src/utils/index.js 100.00% <0.00%> (ø)
platform/core/src/utils/isImage.js 100.00% <0.00%> (ø)
platform/core/src/services/ServicesManager.js 100.00% <0.00%> (ø)
... and 48 more

Continue to review full report at Codecov.

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



const setupRouteInit = async () => {
const seriesInstanceUID = query.get('SeriesInstaceUID');

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Grab from the query the actual full list of parameters as the filters, and then exclude the studyInstanceUIDs parameter from it, as that one shouldn't be present. Something like:
const filters = Object.fromEntries(query.values.filter(([key]) => key!='StudyInstanceUIDs'))
You should play with that in a nodejs command line tool - I may well not have it quite right there.

Thomas Forster added 3 commits October 14, 2022 16:16
if (!valueElem) return false;
if (valueElem.vr == 'DA') return this.compareDateRange(testValue, valueElem.Value[0]);
if (valueElem.vr == 'DA')
return this.compareDateRange(testValue, valueElem.Value[0]);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If this is a separate line, it needs { around it

sortFunction
);
const data = await retrieveMetadataLoader.execLoad();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Please revert empty changes

const query = useQuery();
const params = useParams();

// console.log('\n\n\n\n\n\n', { params, query }, '\n\n\n\n\n\n');

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Please delete the console.log message

};

static seriesFilterKeys = {
SeriesInstanceUID: '0020000E',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Can you add SeriesNumber to this list just to be able to test with an extra parameter for the filters.

@wayfarer3130

Copy link
Copy Markdown
Contributor Author

@sedghi - other than two small changes I think this one is ready to go - it adds the ability to choose which series to display on going to the viewer page Otherwise doesn't affect functionality.

@wayfarer3130 wayfarer3130 changed the title WIP Display series specified by URL parameters in viewer Display series specified by URL parameters in viewer Oct 17, 2022
: new api.DICOMwebClient(qidoConfig);
const wadoDicomWebClient = new api.DICOMwebClient(wadoConfig);

const wadoDicomWebClient = new StaticWadoClient(wadoConfig);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ALireza requested with have the staticWado ? .... style instead of replacing the thing entirely

Comment on lines +259 to +266
const filters = Array.from(query.keys()).reduce(
(acc: Record<string, string>, val: string) => {
if (val !== 'StudyInstanceUIDs') {
return { ...acc, [val]: query.get(val) };
}
},
{}
);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can you please write down what this reduce is making as a comment? like as an example in the top of it

servicesManager,
studyInstanceUIDs,
dataSource,
filters,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this might need to be passed to the custom init above as well

@sedghi sedghi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is great addition. one major comments

Currently the filter only works if it is lower case seresInstanceUID and it does not work with SeriesInstanceUID. Since we have StudyInstanceUIDs right now as a param in URL this will be super confusing. We need to fix this before merge, and also possibly somewhere add some documentation

Comment on lines +259 to +269
/**
* The next line should get all the query parameters provided by the URL
* - except the StudyInstaceUIDs - and create an object called filters
* used to filtering the study as the user wants otherwise it will return
* a empty object.
*
* Example:
* const filters = {
* seriesInstaceUID: 1.2.276.0.7230010.3.1.3.1791068887.5412.1620253993.114611
* }
*/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice comment, please keep it up always with details. Grat job

@sedghi sedghi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks great, eventually we should have a page on doc (makes sense when we support more filters?) that demonstrate this feature. But for now good to go

@sedghi
sedghi merged commit 2507a4b into OHIF:v3-stable Oct 25, 2022
@TFRadicalImaging
TFRadicalImaging deleted the feat/add-series-instance-uid-query-parameter-to-ohif-core branch November 1, 2022 17:36
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