-
Notifications
You must be signed in to change notification settings - Fork 84
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
Operator results #567
Operator results #567
Conversation
To test:
|
Try not let this side track the discussion, this is just a comment on nomenclature. "Artifacts" has a really bad meaning and we very often discuss them in tomography / visualization. Can we give it a new name? I'm open to anything, some suggestions: "Child", "Output", "ProcessedData", "Offspring", "Creation". |
I'm not attached to "artifact", and am open to suggestions. Ideally, the name would differentiate these kinds of secondary outputs from the main result of the operator. Do you have a word that you use for a secondary result or secondary analysis? |
How about "Product" or "Result"? |
"Result" sounds good. |
This class is a wrapper object for new data outputs produced by an Operator.
This commit adds member functions to specify the number of artifacts an operator produces and to set those artifacts from VTK data objects.
c09ddf8
to
4b05e48
Compare
Name changed from "Artifact" to "Result" |
@cryos ready for review when you get a chance |
@cjh1 Mind taking a look? |
Sure, I will take a look now. |
@cquammen Do I need a particular version of ITK, I am getting the following error:
|
I am also seeing the following compiler warnings ( not sure if this PR introduced all of them ):
|
You will need to have ITK built with the following types wrapped: ITK_WRAP_VECTOR_COMPONENTS:STRING=3 |
Compiler warnings are new. Fixing... |
Should we update the ITK build instructions to include those options? |
Yes, and I will probably need to update the prebuilt ITK that the tomviz superbuild uses. |
After changing those options my ITK configure gives me:
The build now fails. |
Hrm... I will send you my ITK CMakeCache.txt file. I am building ITK 4.9rc01 btw. 4.9 should be fine, though. |
Ok, thanks, I'm using 4.9 |
VTK objects can be created in Python and returned to the C++ side by returning a dictionary of values from the 'transform_scalars' function. It is assumed that each key in the dictionary has a vtkObject value that will be wrapped by an OperatorResult.
Added function to read in a text file with a given file root and an extension. Made existing readInPythonScript function use this function and added a readInJSONDescription function to load JSON text files.
Use that support for loading the JSON file in the Connected Components filter.
This is a handy function to create vtkTables from 2D numpy tables. Modified ConnectedComponents.py to use the function.
WIP for issue is here: http://review.source.kitware.com/#/c/21484/ |
@cjh1 For now, you should also be able to leave the option |
@cquammen Thanks, I was able to compile ITK using that default. |
@thewtex Thanks for taking a look at this. |
{ | ||
int previousSize = m_results.size(); | ||
if (previousSize < n) | ||
{ |
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.
Opening brace on line above ( there are a couple of places )
@cquammen Code looks good, just a few minor formatting issue ( being on clang-format :-) ). Tested it out and works as expected. I have a few question:
|
Thanks for taking a look, @cjh1.
Yes. It would also be good to add some kind of table/spreadsheet icon for vtkTable results, and bring up a SpreadSheet View or update an open SpreadSheet view when it is left-clicked on. I was wondering if you might want to tackle that (we should discuss the behavior with the larger group first).
@cryos and I have talked about describing operators in JSON for automatic UI generation, enabling/disabling menu items and toolbar items, etc. Think ParaView filter descriptions in XML, just in JSON and tomviz specific. The examples I have provided are not set in stone - they're just a proposal for what the JSON files might look like. Marcus has some sketched out, too, I believe. I wanted to get a couple in here mainly to describe the operator results.
Excellent question. So far, I believe we have decided further operations will not be allowed on operator results. However, I will next work on supporting "child" data sets, such as binary label maps from image segmentation algorithms. Operators will be allowed on these child data sets.
The |
It would be nice to consider what new build options we need in ITK, I can test these locally too, document them, and then get the ITK in the superbuild updated assuming we need them all. Ideally it would be good to stick to the things we really need in ITK, if that is all the new options you added then that is fine, but if some are there and unlikely to be required I would prefer to cut the list down/have a simpler ITK. This is looking great, will try and get it compiled later. Looking forward to getting some chart views of this too. What operators do you want on child data sets? I thought just visualization modules were planned at this stage. |
Oh, I thought @Hovden wanted to be able to apply operators on child data sets. I might have misunderstood. |
Would be happy to. |
The reason I asked about operator on operator result as it may have an impact on the threading work I am doing ... |
@cjh1 Did you have any luck getting this to run? |
What ITK is this branch proposing to move Tomviz to, and what are the build options it is adding above and beyond what https://github.com/OpenChemistry/tomviz/blob/master/BUILDING.md asks for? |
Let's stick with v4.9.0 for now. I ran into build errors with v4.9.1, and am building 4.10.0 right now, which seems to have resolved them. You should use the ITK you may already have built for now. If there is an error message when you run the Connected Components operator, set the type wrapping options in ITK to: -DITK_WRAP_complex_double:BOOL=OFF I intend to further investigate building the subset of ITK that we need after the segmentation work is in place. Initial attempts to turn on only some of the modules exposed some problems in the form of additional and unsatisfied module dependencies that weren't really needed. This problem should be fixed in master, apparently. Each new ITK build takes over an hour, so the configuration for a working and streamlined ITK will take some time to get right. |
FWIW, after exploring the use of ITK v4.9.0, v4.9.1, v4.10.0, and master (3174f0d5831870caf89af7f9c02a76d9287a60c1), the only version that I have gotten to build and work successfully with tomviz on Mac OS X is v4.9.0. |
@cquammen What issue came up with master? |
@cquammen it would be great to consider whether these early branches can use the ITK we have in the superbuild (4.9.0 I think) with the same build options - this gives us a better chance of having nightly binaries that I can use at ToScA to show off new segmentation features. Failing that, considering a minimal change from the build options we had would be great. I would like to avoid spending too much time changing ITK versions and/or build flags unless absolutely necessary. I would like to concentrate on the minimum needed to show viable ITK filters in Tomviz at this stage, and get the GUI elements in the application. We will have time to go and revisit additional features we want/need from ITK once we have some of the support in the application. |
@cryos These changes were developed against the ITK v4.9.0 build in superbuild. They should work under any more recent version of ITK as well, aside from problems with the Python bindings I have run into. Please review under that assumption. I would like to get this merged today if possible to get the child data set work in place. For posterity, my mistake was attempting to speed up the ITK build by turning off unneeded things, getting to an unusable build, then assuming any more recent version of ITK would be fine. BTW, I recommend avoiding |
@thewtex I think this was my mistake. The error complains about compile-time numpy not matching runtime numpy. |
Just to be clear, the current build instructions for ITK in https://github.com/OpenChemistry/tomviz/blob/master/BUILDING.md are valid. I originally told @cjh1 to modify an additional option to try to reduce the number of unneeded template instantiations without having tested it ahead of time. |
@cryos Are you happy with this change as is? |
Yes, merging now, we can pick up any pieces during the week. |
I was traveling/offline most of yesterday - that was the only reason for any delay @cquammen |
No problem. Thanks for reviewing and merging. |
This branch introduces operator results, data sets that are "byproducts" of an operator. Examples include spreadsheets containing information about segmented objects and spreadsheets with algorithm execution information, but any vtkDataObject can be added as an artifact.
Additionally, this branch introduces a first cut at operator descriptions in JSON. The Connected Components operator serves as an example.
Addresses #497, #498, and partially #525.