Code Monkey home page Code Monkey logo

smallsocc's People

Contributors

ryanneph avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

lynch829

smallsocc's Issues

Feedback from HW

After each leaflet position change request is made to HW, don't allow any further interaction until positive feedback is received from HW.

During a treatment plan, don't advance to next leaflet sequence or start its timer until these feedback signals are received.

If negative feedback is received, place SW in "ERROR" state such that no interaction can occur until acknowledged and treatment plan is stopped. This state should be "bright" in some way to get the user's attention. Overlaying a red rectangle with a single button should be sufficient.
soc_issue 8_mockup

Calibration Mode (Manual)

A manual calibration mode is requested to synchronize the leaflet positions between software and hardware.
The usage would be as follows:

  1. press "Start Calibration" button
  2. use software interface to select each leaflet and change its position until physical position of the leaflet in hardware matches the users expectation of "home" or "origin".
  3. press "Stop Calibration" button

Implementation details:

  • After [step 1], All software limits on leaflet position and collision detection will be temporarily disabled.
  • During [step 2], disable/freeze the SW SOC display, but allow unrestricted input into "Extension" spinbox. After each change, send unrestricted absolute position to update HW.
  • After [step 3], don't request any movement from hardware, send "encoder position reset" signal to HW, reset internal SW position of each leaflet to extension=0 and re-enable position sync between HW and SW.

HW integration

The following tasks should be implemented in support of the hardware/software integration:

  • parity between hw driver recognized control byte sequences and the signals sent by sw
    • synchronization procedure - relying on stepper motor "endstop" sensing and embedded offsets (to ease in calibrating with hardware (similar to 3d printer RepRap g-code commands: M212)
    • agreement between # of steps for full range of motion
    • agreement between leaflet position vs index in driver code and gui
    • Replacement of USB Hardware ID (HID) in gui code with that of SOC microcontroller
  • leaflet collision prevention in:
    • leaflet sequence generation algorithm?
    • user-facing gui control
    • validation on load-from-json?
    • hardware driver? (if two complementary leaflets are to be moved simultaneously, move leading leaflet first so that it can "get out of the way" of the trailing leaflet; this may not prove to be problematic though).

ListView visual states are not properly cleared after save to json file

ListView delegates have a number of visual states that reflect the underlying state of the data attached to them. The "Modified" state indicates any SequenceItem in the list that has had its leaflet extensions or metadata modified but hasn't yet been saved to json file.

The intended functionality is for the states of all SequenceItem delegates in the listview to revert to the default state after a successful save-to-json operation. This is currently unhandled and results in lingering "Modified" states on previously modified items in the present application runtime.

Options for handling include:

  • grabbing a list of children (which is a superset of the list of delegates) from the ListView and filter so that a loop can be performed only over the delegate list, resetting the states of each. This is bad practice in the separate model-view-controller framework used in Qt5 and should not be preferred.
  • Keeping the state on the SequenceItem in the model and only displaying the delegate based on the underlying model item state. This is the cleanest way of allowing external read/write access to the enum underlying the visual state of the delegate but would likely require rework of the python SequenceItem class to have explicit @pyqtProperty decorators that register the properties with the qml dynamic binding engine. The concept of NamedMembers may be dissolved in the process.

Implement timecode-based leaflet sequence progression

Current SequenceItem objects have a timecode_ms attribute that is intended to indicate how long after beginning the treatment plan the leaflet configuration should be automatically set on the collimator hardware.

To include this functionality the following minimal set of features should be added:

  • play/pause/stop buttons
  • indication of which SequenceItem is active at any time
  • time elapsed/time remaining counters...
  • precise timing (possible in separate thread) for advancing to next configuration

The following optional features can also be considered:

  • interactive timeline
  • handshake with small animal irradiator for closed loop synchronized control rather than open loop timing-based control

Kickoff Tasks

This is just a replication of the task list that was originally proposed by email:

So far I had a few features in mind which can be augmented or trimmed based on your vision for the project:

  • (GUI) Save to, Load from leaflet-sequence files - Including specification of automatic switching (time to spend at each sequence) or manual switching ("forward" & "backward" buttons to be used during treatment).

    • Save to - drag or enter each leaflet position then save a "snapshot" of the sequence to a specially formatted file for recall later.
    • load from - populate a sequence list in gui that allows editing a sequence, changing order, adding/removing new sequences, and moving to any sequence on click...
  • (GUI) Mode selector - switch between realtime-draggable position setting and move-only-on-confirm position setting.

  • (GUI) keyboard control - arrow keys to extend/retract by a configurable amount.

  • (Algorithms) fluence map to leaflet position backend function for automatically positioning leaflets to produce desired dose distribution

  • (HW/GUI) Synchronize position of hw leaflets and software representation. In most environments, this means installing limit switches or hall effect sensors that detect when moving parts reach "endstops" and trigger the switch. After initiating a calibration, all steppers are activated until endstop is triggered and then stopped. Then HW and SW are synchronized and ignoring drift, steppers can keep the two synchronized until another calibration is launched. Essentially follow the same process used by 3D printers prior to each print.

    • implement HW control for launching calibration phase, and return signals indicating new positions either after a successful move or periodically during a move at some polling rate.
  • (GUI) Display dicom image within field based on relationship between dicom position and isocenter specification. Shift image so selected isocenter falls in center of field. This can later be leveraged as a control/feedback of treatment couch movement.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.