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

ENH: Allow specification of reference attribute for parameters of type file #8

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

Conversation

cdeepakroy
Copy link

I have a use case wherein a CLI segments the nuclei in a histopathology image and generates an annotation file (json) containing bounding boxes of all nuclei.

The code that creates the web-front end for this CLI needs to know which image the generated annotation file belongs to, so it could ingest all the nuclei annotations/bounding-boxes into a database with key being the Image-Id.

@cdeepakroy
Copy link
Author

@jcfr can you please take a look at this.

Should i allow the reference attributes for all external types here by checking for self.isExternalType()

@cdeepakroy cdeepakroy closed this Jun 1, 2016
@cdeepakroy cdeepakroy reopened this Jun 1, 2016
@zachmullen
Copy link
Member

Hello,

Can anyone give this a quick QA/merge? We are in need of this change for a downstream toolkit and would love to be able to install directly from the main repo.

Thanks!

@hmeine
Copy link
Contributor

hmeine commented Aug 1, 2016

Did you see commontk/CTK#623 ? The problem is that the semantics for the reference attribute are not clear. I can totally see your point, and am not opposed to the change, but apparently, the meaning of the attribute was never formalized and can be misunderstood. Maybe it would be better (and easier to agree on / get integrated into CTK and ctk-cli) to introduce a new attribute like source-image or so?

@pieper
Copy link
Member

pieper commented Aug 1, 2016

I like the idea from Hans.

On Mon, Aug 1, 2016 at 9:45 AM, Hans Meine [email protected] wrote:

Did you see commontk/CTK#623 commontk/CTK#623
? The problem is that the semantics for the reference attribute are not
clear. I can totally see your point, and am not opposed to the change, but
apparently, the meaning of the attribute was never formalized and can be
misunderstood. Maybe it would be better (and easier to agree on / get
integrated into CTK and ctk-cli) to introduce a new attribute like
source-image or so?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#8 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAHsfecWZ_tEqlwI8RYXGQ8CWwEambw_ks5qbfhtgaJpZM4Irod3
.

@zachmullen
Copy link
Member

Ah, I see. Yes, we are using it right now for a reference to the source image, but I think the intent was to keep it intentionally vague so that it could be used to store arbitrary provenance information. It's a difficult problem to try and enumerate the whole ontology surrounding provenance, so this field allows us to capture whatever we need and pass it in an opaque, application-specific way, and support future uses of it as well without having to modify the spec.

I agree we should add documentation for the field before going any further with it.

@hmeine
Copy link
Contributor

hmeine commented Aug 1, 2016

Yes, please. The main goal of the CLI spec and interface is to prevent "opaque, application-specific ways". ;-)

I agree that the "whole ontology surrounding provenance" is hard to tackle, so let's try to start with very specific use cases. It seems that you have one, which is very good, because I could not get any definitive answer ("XY uses it for …" instead of just "I think I saw someone using it in the past") when I looked for an explanation of the reference attribute. :-)

So, my suggestion is to start by enumerating very specific, single use cases, and later try to generalize, if possible at all.

@zachmullen
Copy link
Member

Ideally a general purpose library such as CTK could be applied to novel problems without requiring an upstream change for each new use case, which I think was the idea here. Using opaque data fields is not unprecedented for maximizing interoperability and generality of an API. A couple examples: OAuth with their state parameter, or curl's use of void* userdata for passing user-defined, application specific data types through their callback API.

For us, there is a lot of value in having a general purpose field like this, it could make it quite easy for us to use CTK in a wide variety of applications moving forward. At this time, there is not a lot of value for us in attempting to build formal provenance models. Of course, I am not a maintainer of this project, this is just my 2c as a user. 😄

@hmeine
Copy link
Contributor

hmeine commented Aug 1, 2016

I highly appreciate your input! (This is a community project, so your voice does not count less than others.)

I think we agree, the question is just "how opaque" something is. For instance, I have started this ctk-cli project as part of trying to get CLIs integrated in MeVisLab (instead of Slicer). When doing so, it is very important to get an idea of how existing attributes are used in practice, and it becomes impossible to support them if there's no explanation at all.

In this case, my question would be: Is there any value in supporting the attribute in different host environments? If the answer is "no", then one might go with an opaque value, but I would suspect (and hope) that it is possible to describe the use case and purpose of the attribute, such as to support its use in various host applications (Slicer vs. MeVisLab vs. MITK vs. nipype…).

@cdeepakroy
Copy link
Author

While i totally agree that it is important to document the semantics of the reference attribute, i feel for whichever reason due to which it is currently enabled for parameters of types - image, transform, geometry, table that reasoning should also apply to parameters of the 'file' type.

For example, can we dig out the reason to allow the specification of the reference attribute for parameters of type table?

Maybe this generalizes to anything that CLIParameter.isExternalType returns True for except directory may be.

@hmeine
Copy link
Contributor

hmeine commented Aug 1, 2016

That's exactly what I have been trying to do with commontk/CTK#623 .

You're just the first actual user of this attribute (even in a new context) that I am getting a hold of. ;-)

@cdeepakroy
Copy link
Author

Any resolution on this?

I have now also exposed the coordinateSystem attribute for region typed parameters.

jbeezley added a commit to girder/girder that referenced this pull request Sep 28, 2017
The addition of the reference attribute in ctk-cli is included in
an unmerged PR:

commontk/ctk-cli#8

HistomicsTK relies on a fork of ctk-cli for this addition.  Rather
than remove the feature all together, I have removed the test so
that item_tasks doesn't rely on a fork.  Instead, we will install
the fork for HistomicsTK deployments.
@hmeine
Copy link
Contributor

hmeine commented Feb 5, 2018

Code-wise, this change looks trivial enough to be merged. What is the conclusion concerning the XSD / spec?

zachmullen pushed a commit to girder/girder-item-tasks that referenced this pull request Oct 4, 2018
The addition of the reference attribute in ctk-cli is included in
an unmerged PR:

commontk/ctk-cli#8

HistomicsTK relies on a fork of ctk-cli for this addition.  Rather
than remove the feature all together, I have removed the test so
that item_tasks doesn't rely on a fork.  Instead, we will install
the fork for HistomicsTK deployments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants