-
Notifications
You must be signed in to change notification settings - Fork 24
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
Allow to add datasets through wk-connect #3843
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.
Nice work and refactoring 👍 Will test now.
frontend/javascripts/messages.js
Outdated
@@ -125,6 +125,8 @@ In order to restore the current window, a reload is necessary.`, | |||
"task.recommended_configuration": "The author of this task suggests to use these settings:", | |||
"dataset.clear_cache_success": "The dataset was reloaded successfully", | |||
"dataset.upload_success": "The dataset was uploaded successfully", | |||
"dataset.add_success": "The dataset was added successfully", | |||
"dataset.add_error": "Could not reach the datastore", |
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.
No trailing fullstops here? :) Only asking because you added them a few lines below ^^
@@ -363,6 +364,21 @@ export type DatasetConfig = { | |||
+zipFile: File, | |||
}; | |||
|
|||
type wkConnectLayer = { |
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.
Maybe WkConnectLayer
?
type: "image" | "segmentation", | ||
}; | ||
|
||
export type wkConnectDatasetConfig = { |
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.
Also capital W
maybe?
@@ -363,6 +364,21 @@ export type DatasetConfig = { | |||
+zipFile: File, | |||
}; | |||
|
|||
type wkConnectLayer = { | |||
source: string, |
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.
It's not clear to me what source is. Is it an url? Then I'd suggest sourceUrl
.
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.
Unfortunately this is coming from Neuroglancer and wk-connect adopted the same format for simplicity's sake, but yes it is the URL.
If we really want to we could change it, but I think adding a comment will be easier
export type wkConnectDatasetConfig = { | ||
neuroglancer: { | ||
[string]: { | ||
[string]: { |
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.
Can you add a "variable name" for these two string keys? For example, [datasetName: string]
. The var name only serves for documentation. For the layer name, it's clear to me, but what is the other hierarchy? Is it the setting name?
await addWkConnectDataset(formValues.datastore, datasetConfig); | ||
|
||
Toast.success(messages["dataset.add_success"]); | ||
trackAction("Add remote dataset"); |
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.
Why "remote dataset"? I'd use wk-connect
here since it might be hard to map in the future when we analyze the data. Also, I'd move this into line 79, since we probably are interested in how often this is tried at all. Failed attempts wouldn't be tracked right now.
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.
Good point, I renamed and moved it :)
showSearch | ||
placeholder="Select a Datastore" | ||
optionFilterProp="children" | ||
style={{ width: "100%" }} |
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.
Maybe add defaultActiveFirstOption
as a prop so that the first item is autoselected.
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.
Did the auto selection of the first item not work for you during testing?
defaultActiveFirstOption
does not work if datastores
is []
at first and then updated later, it only works on the initial render.
That's why I instead set the initialValue
in the field decorator (couple of lines below) which worked on subsequent renders as well for me :)
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.
Ah, sorry, you are probably right. I reviewed the code before testing :)
<div style={{ padding: 5 }}> | ||
<CardContainer withoutCard={withoutCard} title="Add wk-connect Dataset"> | ||
Currently wk-connect supports adding Neuroglancer datasets. Simply set a dataset name, | ||
select the wk-connect datastore and paste the URL to the Neuroglancer dataset. |
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.
In which cases would we have more than one wkc datastore here? Is this a usecase at all? It seems a bit "complicated" to me, that the user has to deal with it at all, because most of the time they won't care.
However, it's fine for now, I think. We can always streamline this later :)
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.
I wasn't sure, but you're probably right, there's either one or none wk-connect datastores I'd say. Do you agree @normanrz?
}, | ||
}, | ||
], | ||
validateFirst: true, |
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.
👍
@@ -210,11 +211,21 @@ const OrganizationForm = Form.create()(({ form, onComplete }) => { | |||
|
|||
class OnboardingView extends React.PureComponent<Props, State> { | |||
state = { | |||
currentStep: 0, | |||
currentStep: 2, |
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.
This should probably be undone, right?
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.
Oops 🙈
I tested it locally and it works beautifully 👍 Didn't test in depth, though. Do we want to the testing protocol for that? |
@daniel-wer I added a dummy max segmentation id and also the dataFormat field (open PR draft). The resolutions seem to be formatted wrong, I'm looking into that tomorrow in detail. See scalableminds/webknossos-connect#64 |
@jstriebel Nice, thanks :) Should we add some documentation regarding wk-connect in this PR (or does some documentation exist already)? @fm3 Could you update the migration guide? A datastore update is not required afaics, right? I'll update the changelog and do one more testing round. |
Correct, no changes to datastore or tracingstore. I updated the migration log :) |
There is no documentation available so far. I would do that in a separate PR, and then also consider to include wk-connect in the docker-compose setup to try it out easily. |
see #3867 |
…-wk-connect-dataset
I tested and the important things worked very well, editing is no longer a problem, great work :) 🎉 I encountered these issues (I am fully aware that wk-connect is not feature complete and WIP, but I think it has value that we collect and list these issues :) ):
If we fix the first two issues and maybe take care of the fourth, this should be good to merge imo :) |
@daniel-wer |
Re 4bit-mode: I opened a PR that implements 4bit-mode support: scalableminds/webknossos-connect#67 |
…-wk-connect-dataset
@philippotto If you approve I would go ahead and merge this tomorrow :) |
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.
Sorry, I forgot to approve!
This PR adds an additional tab to the "Add Dataset" view, which allows to add a Neuroglancer dataset to wK using a webknossos-connect datastore. The Neuroglancer dataset is identified using the URL, all the layer information is parsed from that.
I'm not that happy with the code, as there's quite a bit of duplication between the Upload Dataset and Add wk-connect Dataset tabs, but I couldn't find a better abstraction to combine the two, maybe that's ok for now.
Issues that need to fixed:
(both fixed in datasource-properties: add largestSegmentId, dataFormat & wkwResolutions webknossos-connect#64)
URL of deployed dev instance (used for testing):
Steps to test:
Issues:
- [ ] Updated documentation if applicable- [ ] Needs datastore update after deploymentExample Neuroglancer dataset URL:
https://neuroglancer-demo.appspot.com/#!%7B%22layers%22:%5B%7B%22source%22:%22precomputed://gs://neuroglancer-public-data/kasthuri2011/image%22%2C%22type%22:%22image%22%2C%22name%22:%22original-image%22%2C%22visible%22:false%7D%2C%7B%22source%22:%22precomputed://gs://neuroglancer-public-data/kasthuri2011/image_color_corrected%22%2C%22type%22:%22image%22%2C%22name%22:%22corrected-image%22%7D%2C%7B%22source%22:%22precomputed://gs://neuroglancer-public-data/kasthuri2011/ground_truth%22%2C%22type%22:%22segmentation%22%2C%22selectedAlpha%22:0.63%2C%22notSelectedAlpha%22:0.14%2C%22segments%22:%5B%2213%22%2C%2215%22%2C%222282%22%2C%223189%22%2C%223207%22%2C%223208%22%2C%223224%22%2C%223228%22%2C%223710%22%2C%223758%22%2C%224027%22%2C%22444%22%2C%224651%22%2C%224901%22%2C%224965%22%5D%2C%22name%22:%22ground_truth%22%7D%5D%2C%22navigation%22:%7B%22pose%22:%7B%22position%22:%7B%22voxelSize%22:%5B6%2C6%2C30%5D%2C%22voxelCoordinates%22:%5B5519.10400390625%2C8531.5380859375%2C1196.4942626953125%5D%7D%7D%2C%22zoomFactor%22:22.573112129999547%7D%2C%22perspectiveOrientation%22:%5B0.3849591314792633%2C0.6616792678833008%2C-0.6423912644386292%2C-0.0363389253616333%5D%2C%22perspectiveZoom%22:340.35867907175077%2C%22layout%22:%224panel%22%7D