Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Embedding niftynet into a custom python code (a.k.a. module API) #124

Open
somsol opened this issue Jun 13, 2018 · 7 comments
Open

Embedding niftynet into a custom python code (a.k.a. module API) #124

somsol opened this issue Jun 13, 2018 · 7 comments
Assignees

Comments

@somsol
Copy link

somsol commented Jun 13, 2018

I want to have a python script in which I apply some preprocessing steps to my data and then feed it to a neural network of choice. How can I do this without the need to write the processed data into disk prior to calling niftynet.main()? Is there a way to input the data that is already in memory into a neural network? Likewise, is there a way to get the output of the network without saving it to disk (for postprocessing purposes)?

Any help would be most appreciated.

@wyli
Copy link
Member

wyli commented Jun 15, 2018

duplicate of #99?

@tvercaut
Copy link
Member

@tvercaut
Copy link
Member

tvercaut commented Jan 17, 2019

For ease of reference, I am copy-pasting the content of https://cmiclab.cs.ucl.ac.uk/CMIC/NiftyNet/issues/240 here.

Using NiftyNet as a module

It is currently not trivial to run NiftyNet as part of a separate python script. It would be nice to have an alternative to run_application() that let you do the following:

nn = ApplicationDriver()
nn.initialise_application(system_param, input_data_param)
my_output_data_dict = nn.process_image(my_input_data_dict)

This would enable NN to be used more easily in complex pipelines, and integrated more easily into interactive systems.

This would require a few modifications:

  1. a process_image function that takes in a dictionary of data (matching what you would get from a reader?), processes it as if it had been read from a file, and returns the results as would be written to a file.
  2. to facilitate this, the reading/writing to files would need to be decoupled from the preprocessing and the sampler systems.

@tvercaut tvercaut changed the title embedding niftynet into a custom python code Embedding niftynet into a custom python code (a.k.a. module API) Jan 17, 2019
@somsol
Copy link
Author

somsol commented Jan 17, 2019

Does it mean that you're still working on this? Please let me know when you get there. Thanks

@ericspod
Copy link
Collaborator

Work is still ongoing with the pull request associated with this ticket.

@bor2093
Copy link

bor2093 commented Aug 26, 2019

Hi guys,
I think this feature is really great. I wonder if there is any progress in merging to dev branch...

@srivathsapv
Copy link

Any updates on this feature?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants