Comments (4)
Design pattern is an open question. Giving up the facade would mean having too many uncategorised options. At the moment the applications are collected under agents (or worker) and the tool is accessible according to their semantic. They are intended to work as drawers where you may the required tools.
e.g. to get to the relabel, you type:
nil.manipulate.relabel(...
To get a segmentation with Otsu you will do:
nil.segment.otsu_thresholding(...
And the classes LabelsManipulate
and LabelsSegmenter
are hidden from the user, that does not need to remember their names. If the user know what she wants and how to use auto-completion, she should be able to reach the right app, or to know that the app is not there yet.
I was afraid that allowing for direct call (nil.otsu_thresholding
or nil.relabel
) would remove the categorisation and would make reaching a method with auto-completion more lenghty.
Could be even better if you could do:
import nilabel as nil
nil.segment.otsu_thresholding(...)
Instead of
from nilabel.main import Nilabel as NiL
nil = NiL()
nil.segment.otsu_thresholding(...)
But this I guess has to do with the import method (and the __init__.py
in the main root) rather than the class architecture.
So the current choice I made is not the best one. The issue remains open, as refactoring class is well considered, after better importing system.
from nilabels.
Currently main
is deprecated for agents.AgentsController
and it works like:
import nilabels as nis
nis_app = nis.App('optiona_input_data_folder', 'optional_output_data_folder')
nis_app.manipulate.relabel('in_data_or_full_path.nii.gz', ...)
With nis.<tab>
you can access tools
(acting on numpy arrays or nibabel images), agents
(facade of tools acting on paths), and App
(facade of facade agents).
Still considering more intuitive names than agents
or App
. Any idea?
from nilabels.
Are you using the command design pattern as mentioned here or the facade design pattern?
from nilabels.
Facade. Documentation updated, thanks!
from nilabels.
Related Issues (8)
- update links to niftynet and niftyseg HOT 1
- Standardise README section headers
- Use nouns as class names not verbs HOT 2
- Remove phantom generator in an independent repository and reduce size of the test. HOT 1
- Update circleCi reference in the README
- How to convert connected components into labels HOT 1
- Convert one multi-labeled segmentation file to individual slices '.stl' file HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nilabels.