-
Notifications
You must be signed in to change notification settings - Fork 10
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
carli/1758_multiprofile_intensity_unit_conversion #2185
carli/1758_multiprofile_intensity_unit_conversion #2185
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall the code looks good, and I have some initial comments. Please also update the description in the PR with the new changes.
src/stores/Widgets/SpectralProfileWidget/SpectralProfileWidgetStore.ts
Outdated
Show resolved
Hide resolved
src/stores/Widgets/SpectralProfileWidget/SpectralProfileWidgetStore.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@crocka If we just load one image and apply intensity unit conversion, it appears that the function is broken. I can see the ylabel of the spectral plot changes accordingly but not the values. Could you have a look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good now. no regression from e2e tests. 👍
Description
The pr resolves #1758 and resolves #1907. It tackles three problems. First, the spectral profiles for different frames when matched should convert to the same intensity unit. Second, spectral matching should be avoided if two images do not have intersecting intensity unit. Third, the intensity unit option should only show the ones that are usable for each of the spectrally matched images.
Originally in the
SpectralProfileWidgetStore
, theintensityConversion
observable is singular, mapping theeffectiveFrame
to the selected intensity unit. This is undoubtedly incorrect if we have more than one frame. To solve this issue, theintensityConfig
object was move toFrameStore
, and theintensityConversion
is uniquely produced in plotData for each of the frames' profile. To access the frame that correspond to each profile, the frame store of the frame is added to the profile object in theprofiles
array inSpectralProfileSelectionStore
.Another problem that the pr solves is that the program should avoid spectral matching when the spectrally matched images do not have common intensity unit. This condition is added to the if-statement in
setSpectralReference
function inFrameStore
using thegetCommonIntensityOptions
function. ThegetCommonIntensityOptions
function searches for the common or intersecting intensity unit with 1) a second frame's intensityConfig, if the arguments is a single IntensityConfig, 2) an array of frame's intensityConfig, if the argument is an array rather than a single instance of IntensityConfig.The third problem is to allow only the intensity units available for all of the spectrally matched images to show in the intensity option. Knowing that the
getCommonIntensityOptions
function finds the intersecting intensity unit, theintensityOptions
inSpectralProfileWidgetStore
simple made use of this function.Checklist
For linked issues (if there are):
For the pull request:
no changelog update neededprotobuf updated to the latest dev commit/ no protobuf update neededBackendService
unchanged /BackendService
changed and corresponding ICD test fix added