OHIF / Viewers

OHIF zero-footprint DICOM viewer and oncology specific Lesion Tracker, plus shared extension packages
https://docs.ohif.org/
MIT License
3.3k stars 3.33k forks source link

WIP: Migrate UI to React #320

Closed swederik closed 5 years ago

swederik commented 5 years ago

This issue tracks the progress of migration to React / Redux from Meteor for the OHIF Viewer application.

Live demo: https://deploy-preview-321--ohif.netlify.com/demo/

We have had a significant amount of requests to migrate off of Meteor to allow the OHIF application and components to be more easily reused in other applications. This change will also make it easier to decouple the application from the server-side component, which is unnecessary if you aren't using DIMSE to communicate with PACS. This Issue will track the work on that front.

If you want to contribute: Please make a comment in this issue to claim some components that you will work on. You can make Pull Requests to the 'react' branch which will be reviewed and merged.

We do not have a timeline for when this work will be completed. If you want it to be done faster, pick up some of the work and help us get it done.

Migration Plans

  1. Consolidate packages and push logic out of OHIF into lower-level libraries (e.g. dcmjs, dicomweb-client, cornerstoneTools) (https://github.com/OHIF/Viewers/pull/297)
  2. Start depending on NPM versions of packages (e.g. moment.js) instead of Atmosphere versions
  3. Port the Blaze UI to React, but continue to use Meteor's build process. Start with the Viewer, then move to the Study List. Use Crowds Cure Cancer code as necessary.
  4. Switch application state management to Redux. Remove Session, Tracker, ReactiveVar, and ReactiveDict usage.
  5. Gap analysis: What prevents us from switching to create-react-app and dropping the Meteor build process? (e.g. Minimongo?, SimpleSchema?)
  6. Move OHIF UI to NPM packages
  7. Remove 'blaze-html-templates' and other blaze-specific packages.
  8. Switch Routing to use react-router(-dom) instead of Iron / Clinical Router
  9. Remove any remaining dependencies on Meteor packages (e.g. cultofcoders:persistent-session) (this has actually been done already on a private fork. Will merge this back ASAP)
  10. Revisit our choice of Stylus as a CSS language (what would be easiest for consumers of the components? Pure CSS? Can we still do theming with another build process?)
  11. Switch to create-react-app / Webpack instead of Meteor for the build process.

Viewer UI Migration Checklist (Updated Feb 19th, 2019)

Components TODO:

Non-Component TODO:

Other missing things:

Note: The Lesion Tracker-specific components can be done last, and will not block merging of React branch into master.

@vsoch @JamesAPetts

EsrefDurna commented 5 years ago

Hello @swederik this is a great news ! I will work with items under. -User Preferences

Thank you

Ash Durna

swederik commented 5 years ago

Short update on the React transition:

Hopefully next week the ohif-core package can be more useful and we can start filling things into that app. Note: It will not start at all if you try it right now, I’ve been trying to clean up the issues with dependencies in ohif-core (I would welcome any help with that!).

Some good places to start:

My short term goal is to get the create-react-app version working with the study list and basic viewer (minus the measurement table) first, and then continue from there. Most of the re-usable logic should be in the ohif-core NPM package (on github, but unpublished), and the UI components within ohif/react-viewerbase. The actual application should be very small.

Some minor stuff:

vsoch commented 5 years ago

hey everyone! I don't use react a lot, but I'd really like to help and learn - would it be feasible to assign a small and scoped task for me to do? If you can describe the basic steps, files involved, for going about this I can give it a go! If it's too complicated, then maybe we can figure out another way that I could help?

EsrefDurna commented 5 years ago

Hello @vsoch Thats a great idea and this project is a great way to learn react. I will have a look during this weekend and will try to find some tasks for you as well.

Thank you so much

diaztula commented 5 years ago

This is a fantastic initiative! I currently use Standalone OHIF Viewer within a React app but it has several limitations. Having OHIF implemented in React would open many new possibilities!

I would like to contribute to this project as well.

Cheers

jamesg1 commented 5 years ago

Great work @swederik ! I use React regularly and working on a medical product using image viewers. Cornerstone/OHIF has been interesting to look into but I have a lack of knowledge on meteor.

Happy to help on some tasks to get the ball rolling.

Styled components is interesting around theming as it would be possible to switch out the theme.js file with different set of attributes to quickly change the look of ohif for clients. That or css modules are common now.

onluiz commented 5 years ago

This is an excelent initiative. React is a greate framework and I believe the final work here will be awesome.

I have worked with cornerstone for a couple of years now and I was always making plans to learn meteor so I could understand OHIF more deeply. Now with react I believe it will be easier!

I will be more than happy to contribute to this project as well.

eggachecat commented 5 years ago

Great! I have some experience in angular.js and vue.js.. I would like to contribute to this project ! And I think the interfaces of measurement may need some improved since it is pretty tricky to add some preloading measurement

atony88 commented 5 years ago

@swederik @pieper Amazing work on migrating the Front-end to ReactJs.

I was able to run the react-app and now I am trying to connect it to our own DICM server. I changed the config file in /react-config/ccc.json and set the wadoUri, run

REACT_APP_CONFIG=$(cat ../../config-react/ccc.json)
yarn start

But I am still connecting to the same server and studies. It's also not clear to me where exactly the server settings are getting set. Is there any other configurations that needs to be done to connect it to another server?

alvarosan commented 5 years ago

Great work! also willing to contribute.

@swederik , what would be the way to go if I wanted to integrate a vtk.js-based custom visualization? My viewport is currently encapsulated in a React component. I saw you recently integrated OHIFVTKExtension (using that as a base for now), I will post here how it goes.

TZubiri commented 5 years ago

I know that mobile isn't officially supported, but it seems that the tech stack used provides an operative second-class citizen mobile app for cheap.

The react version is better than the meteor version in mobile, the old version required that the user request the desktop version through the browser to get a full view of the image, now the viewport fits almost entirely (my 1920*1080 screen at least) by default.

Here is a small list of mobile bugs: Images with series begin with the series list open, which hides the viewport rightmost half. The toolbar appears as a vertical unscrollable dropdown list. I can only choose length and angle, but they both seem to work as expected.

This means that CR images are viewable from mobile!

Congratulations.

matthiasg commented 5 years ago

If the important parts are written runtime independently so they could only be wrapped in React it would open the door to also use Vue (which is more friendly to UX Designers than React). I would offer to invest some time into this if this is a compatible long term goal.

dannyrb commented 5 years ago

We've silently pushed react to master as our new version 2. Expect an announcement early this week. Some features/functionality still need to be ported, but they will be completed iteratively instead of in this large batch form.

More information to come on how individuals can best contribute their varying skillsets to move things forward.