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

Create specs #1

Merged
merged 25 commits into from
Aug 27, 2024
Merged

Create specs #1

merged 25 commits into from
Aug 27, 2024

Conversation

alessandratrapani
Copy link
Collaborator

@alessandratrapani alessandratrapani commented May 25, 2024

TODO:

  • Define Indicator and Effector as general NWB container instead of Device
  • Re-write doc for illumination type
  • Separate diagrams
  • Remove MicroscopyTable

Entity relationship diagrams

Indicator and Effector

%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#ffffff', "primaryBorderColor': '#144E73', 'lineColor': '#D96F32'}}}%%
classDiagram
    direction BT
    class Indicator{
        <<NWBContainer>>
        --------------------------------------
        attributes
        --------------------------------------
        label : text
        description : text, optional
        manufacturer : text, optional
        injection_brain_region : text, optional
        injection_coordinates_in_mm : numeric, length 3, optional
    }
    class Effector{
        <<NWBContainer>>
        --------------------------------------
        attributes
        --------------------------------------
        label : text
        description : text, optional
        manufacturer : text, optional
        injection_brain_region : text, optional
        injection_coordinates_in_mm : numeric, length 3, optional
    }
Loading

Optical Filters

%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#ffffff', "primaryBorderColor': '#144E73', 'lineColor': '#D96F32'}}}%%
classDiagram
    direction BT
    class DeviceModel{
        <<Device>>
        --------------------------------------
        attributes
        --------------------------------------
        model : text, optional
    }
    class DichroicMirror{
        <<DeviceModel>>
        --------------------------------------
        attributes
        --------------------------------------
        cut_on_wavelength_in_nm : numeric, optional
        cut_off_wavelength_in_nm : numeric, optional
        reflection_band_in_nm : numeric, optional
        transmission_band_in_nm : numeric, optional
        angle_of_incidence_in_degrees : numeric, optional
    }
    class OpticalFilter{
        <<DeviceModel>>
        --------------------------------------
        attributes
        --------------------------------------
        filter_type : text, optional
    }
    class BandOpticalFilter{
        <<OpticalFilter>>
        --------------------------------------
        attributes
        --------------------------------------
        center_wavelength_in_nm : numeric
        bandwidth_in_nm : numeric
    }
    class EdgeOpticalFilter{
        <<OpticalFilter>>
        --------------------------------------
        attributes
        --------------------------------------
        cut_wavelength_in_nm : numeric
        slope_in_percent_cut_wavelength : numeric, optional
        slope_starting_transmission_in_percent : numeric, optional
        slope_ending_transmission_in_percent : numeric, optional
    }
    DichroicMirror *-- DeviceModel : extends
    OpticalFilter *-- DeviceModel : extends
    BandOpticalFilter *-- OpticalFilter : extends
    EdgeOpticalFilter *-- OpticalFilter : extends
Loading

Other devices in the optical setup

%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#ffffff', "primaryBorderColor': '#144E73', 'lineColor': '#D96F32'}}}%%
classDiagram
    direction BT
    class DeviceModel{
        <<Device>>
        --------------------------------------
        attributes
        --------------------------------------
        model : text, optional
    }
    class ExcitationSource{
        <<DeviceModel>>
        --------------------------------------
        attributes
        --------------------------------------
        illumination_type : text, optional
        excitation_wavelength_in_nm : numeric, optional
        power_in_W : numeric, optional
        intensity_in_W_per_m2 : numeric, optional
        exposure_time_in_s : numeric, optional
    }
    class PulsedExcitationSource{
        <<DeviceModel>>
        --------------------------------------
        attributes
        --------------------------------------
        peak_power_in_W : numeric, optional
        peak_pulse_energy_in_J : numeric, optional
        pulse_rate_in_Hz : numeric, optional
    }
    class Photodetector{
        <<DeviceModel>>
        --------------------------------------
        attributes
        --------------------------------------
        detector_type : text, optional
        detected_wavelength_in_nm : numeric, optional
        gain : numeric, optional
        gain_unit : text, false
    }
    class ObjectiveLens{
        <<DeviceModel>>
        --------------------------------------
        attributes
        --------------------------------------
        numerical_aperture : numeric, optional
        magnification : numeric, optional
    }
    class OpticalFiber{
        <<DeviceModel>>
        --------------------------------------
        attributes
        --------------------------------------
        numerical_aperture : numeric, optional
        core_diameter_in_um : numeric, optional
    }
    
    ExcitationSource *-- DeviceModel : extends
    PulsedExcitationSource *-- ExcitationSource : extends
    Photodetector *-- DeviceModel : extends
    ObjectiveLens *-- DeviceModel : extends
    OpticalFilter *-- DeviceModel : extends
    BandOpticalFilter *-- OpticalFilter : extends
    EdgeOpticalFilter *-- OpticalFilter : extends
    DichroicMirror *-- DeviceModel : extends
    OpticalFiber *-- DeviceModel : extends
Loading

@alessandratrapani alessandratrapani marked this pull request as ready for review May 25, 2024 13:35
@CodyCBakerPhD
Copy link
Member

FYI I highly recommend using mermaid to create those ER diagrams

Example: https://github.com/catalystneuro/ndx-microscopy/pull/11/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R25

The 'code' for it can then live in the README or some other .md on GitHub so anyone can else modify it if they want

@CodyCBakerPhD
Copy link
Member

FYI I highly recommend using mermaid to create those ER diagrams

Not to mention the current extension is a lot more modular than most others - I'd recommend separate ER diagrams per related group; e.g., you could define a base OpticalFilter that adds filter_type and then separates into Band vs. Edge specific attributes

@CodyCBakerPhD
Copy link
Member

Overall looks good - made first round of comments

@alessandratrapani
Copy link
Collaborator Author

FYI I highly recommend using mermaid to create those ER diagrams

Example: https://github.com/catalystneuro/ndx-microscopy/pull/11/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R25

The 'code' for it can then live in the README or some other .md on GitHub so anyone can else modify it if they want

Yes, thank you for the suggestion. I was planning to do it in Mermaid once I finished this first step. I started with draw.io because it was a simple copy-paste from previous diagrams, and I just wanted to have a reference for this specific PR.

README.md Outdated Show resolved Hide resolved
README.md Outdated
attributes
--------------------------------------
microscopy_type : text, optional
doi : text, optional
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All microscopes have a DOI? I don't think I've ever seen that in the methods/supplemental section

How would I look it up for a particular microscope?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was meant to be there just for custom microscopes. I remember we discussed this a while ago, but I am also not totally convinced that this is something needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would a home-built microscope have a manufacturer or model number?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably not 😑, I need to change this 😅

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are we at on this? Does the base PyNWB device has the manufacturer then you add the model to the new BaseModel?

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@CodyCBakerPhD
Copy link
Member

Change MicroscopyTable to MicroscopeConfiguration (general container) to be linked to MicroscopySeries object

Is this still a TODO?

README.md Outdated Show resolved Hide resolved
Comment on lines +157 to +160
OpticalFilter *-- DeviceModel : extends
BandOpticalFilter *-- OpticalFilter : extends
EdgeOpticalFilter *-- OpticalFilter : extends
DichroicMirror *-- DeviceModel : extends
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intend to duplicate the OpticalFilter and below in both the ophys and fiber photometry?

I think just including it in the separate block above is sufficient unless you also showed how those filters interact as metadata with the other extensions data series (which I think would be better in the respective extensions)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Agree I can simplify it like this

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am correcting this in #2

@CodyCBakerPhD
Copy link
Member

1 question about simplifying the ER diagrams, otherwise looks good!

@CodyCBakerPhD CodyCBakerPhD merged commit 3a5dc62 into main Aug 27, 2024
5 checks passed
@CodyCBakerPhD CodyCBakerPhD deleted the create_specs branch August 27, 2024 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants