Skip to content

class call structure

Jian Tay edited this page Jan 25, 2022 · 1 revision

The user should interact with only one piece of code: the class.

This class will create other classes as necessary to carry out the requested functions.

The output data should be clearly defined.

Why? Depending on the tasks, it could become complicated for the end user to know which classes to create/call. For example, to Track Cells, you would need CySegger and CyTracker.

To only segment cells CySegger.

To count dots, CySegger

The code directory is structured as packages:

Each directory starting with '+' is a package.

Import files from a package using +package.name. Once the classes are imported, you no longer need to use the package name when referring to it.

For example, say you have the following directory structure:

+trackingCode/ +linker1 (which has function trackCells) +linker2 (which also has function trackCells)

You can just import the class you need:

function
    import trackingCode.linker1

    %Call the trackCells() function from linker1.
    A = trackCells(...)
end

https://www.mathworks.com/help/matlab/matlab_oop/importing-classes.html

Clone this wiki locally