SDS doc

  • Upload
    shann

  • View
    213

  • Download
    0

Embed Size (px)

Citation preview

  • 8/16/2019 SDS doc

    1/10

    MMDS – Software Application

    SOFTWARE DESIGN SPECIFICATION 

    1.0 Introduction

    This Software Design Specification SDS! describes system design for TheMagnetic Resonance Imaging Motion Detection System (MMDS) Software

     Application.

     1.1 Background

    Motion of the subect during an MRI scan can cause the image to containdistortions or artifacts. The MMDS application see!s to de"elop a way toeasily inform the MRI operator and subect in real time when non#tri"ial

    motion has occurred. The MMDS application will do this by interfacingwith the MMDS $ardware to Software Interface.

    The MMDS application will act on a synchroni%ed schedule with the MRI inorder to pro"ide accurate information regarding motion "s. time for theduration of the MRI scan.

    The operator will be informed of non#tri"ial motion through a "isual alarmshown in the MMDS application. The subect will be alerted from anaudible alarm through triggered by the MMDS application.

    1.2 Statement of scope

    The MMDS Software Design Specification SDS! focuses on the functionaland technical design for the MMDS Application. This includes the&ommunications' the raphical ser Interface (I)' and the SoundManager.

     1.3 Major constraints

    The MMDS Application will need to be designed to wor! on maoroperating systems (*indows' Mac' +inu,). The biggest constraint

    obser"ed by the MMDS Application will be the need to alert the users inreal time when non#tri"ial motion has occurred.

  • 8/16/2019 SDS doc

    2/10

    2.0 Data design

     A description of all data structures including internal' global' and temporary datastructures.

    2.1 Internal software data structure

    2.1.1 RS-232 ASCII String 

    RS#-- AS&II Strings will be strings that are read from the Serial/ort. These Strings will be parsed into &hannelData0bects. Thestring will be in the following format1

    2s3 "# "$ TM# TM$ TS# TS$ T%S# T%S$ c& 2,3

    *here 2s3 and 2,3 are delimiting characters' 45 and 4- representhe,adecimal "oltage "alues' TM5 and TM- represent minutes' TS5and TS- represent seconds and TmS5 and TmS- representmilliseconds.

    2.1.2 ChannelDataObject 

    &hannelData0bects are used to represent information sent fromthe MMDS $ardware to Software Interface o"er a RS#-- interface.They will contain the following information1 4oltage +e"el' Time'Source &hannel' and 4oltage Threshold.

    2.1.3 UdpFlag 

     A dp6lag is simply a bit representing a boolean flag "alue. Thedp6lag will represent weather or not current motion is tri"ial ornon#tri"ial. This data is sent from a rd party application thatdetermines if motion at the current time in the scan is tri"ial or non#tri"ial.

  • 8/16/2019 SDS doc

    3/10

    3.0 Arcitectural and component!le"el design

     A description of the program architecture is presented.

    3.1 #rogram Structure

    MMDS will follow an 0bect oriented approach to design. *e modelMMDS with a component le"el architectural design. This system will beimplemented using the 7a"a programming language. MMDS will ma!euse of the 0bser"er Design /attern. This pattern is used to implement adistributed e"ent handling system. In our case' the 0bser"er classes willobser"e Serial&ommSubect and dp8,ternalMotionSubect. *hene"er anew &hannelData0bect or a dp6lag is created' they will be sent to the0bser"ers "ia the 0bser"er /attern.

    3.1.1 Arcitecture diagram

    3.1.2 Alternati"es

    *e chose to use a component le"el architecture design because itwould map to obect oriented implementation easily.

  • 8/16/2019 SDS doc

    4/10

    3.2 Description for $omponent Serial$ommSu%ject

    Serial&ommSubect is responsible for all aspects of serial communicationthroughout MMDS.

    3.2.1 #rocessing narrati"e S#'$( for componentSerial$ommSu%ject

    0nce prompted by the user' Serial&ommSubect begins polling theserial port for RS-- Strings. 0nce a string is recei"ed' it is passedto &dotils so that it can be seriali%ed into a &hannelData0bect.These &hannelData0bects are then passed on to all registeredobser"ers.

    Serial&ommSubect will ma!e use of the rd /art +ibrary R,t, to

    simplify RS#-- &ommunication.

    3.2.2 $omponent Serial$ommSu%ject interface description.

    Inputs1 RS#-- Strings

    0utputs1 &hannelData0bects

    3.3 Description for $omponent M$)$ommSim

    This component is used strictly to test MMDS. M&&ommSim is used to

    simulate the $ardware to Software Interface of MMDS. It will be run fromanother computer connected o"er RS#-- interface.

    3.3.1 #rocessing narrati"e S#'$( for componentM$)$ommSim

    0nce prompted by the user' M&&ommSim will begin sending RS#-- Strings across the serial port. The user can specify thenumber of strings to be sent as well as the timing between eachdata transmission.

    3.3.2 $omponent M$)$ommSim interface description.

    Inputs1 0perator 8"ent

    0utputs1 RS#-- Strings

  • 8/16/2019 SDS doc

    5/10

    3.* Description for $omponent SoundAlarm

    Sound alarm is used to play sound through the /& Sound card when a&hannelData0bect is produced that is abo"e the threshold and a

    dp6lag is true.

    3.*.1 #rocessing narrati"e S#'$( for componentSoundAlarm

    When MMDS starts, a .wav fle is loaded into memory.When the GuiObserver receives a ChannelDataObject witha Voltae !evel that is above the threshold and the"d#$la is true, a .wav fle is #layed.

    3.*.2 $omponent SoundAlarm interface description.

    Inputs1 &hannelData0bect

    0utputs1 Sound played through /& spea!er 

    3.+ Description for $omponent $do)tils

    &dotils is a collection of utility methods relating to &hannelData0bects.

    3.+.1 #rocessing narrati"e S#'$( for component $do)tils

    Cdo"tils serves two main #ur#oses. %he frst is used bySerialCommSubject to seriali&e 'S()*) Strins intoChannelDataObjects. %he second is used byMC"CommSim to create random ChannelDataObjects +oruse in testin.

    3.+.2 $omponent $do)tils interface description.

    Inputs1 RS#-- Strings

    0utputs1 &hannelData0bects

  • 8/16/2019 SDS doc

    6/10

    3., Description for $omponent $annelData-%ject

    &hannelData0bects are used to represent information sent fromthe MMDS $ardware to Software Interface o"er a RS#-- interface.

    They contain the following information1 4oltage +e"el' Time'Source &hannel' and 4oltage Threshold.

    3.,.1 #rocessing narrati"e S#'$( for component$anelData-%ject

    ChannelDataObjects are created +rom 'S()*) Strins byCdo"tils.

    3.,.2 $omponent $annelData-%ject interface description.

    Inputs1 set4oltage' set&hannel' setThreshold' setTime

    0utputs1 get4oltage' get&hannel' getThreshold' getTIme

    3. Description for $omponent /ui-%ser"er 

    ui0bser"er is as a conduit for &hannelData0bects and dp6lagsto trigger audible and "isual alarms.

    3..1 #rocessing narrati"e S#'$( for component/ui-%ser"er 

    ui0bser"er is used to store &hannelData0bects into a threadsafe collection. It also stores dp6lags in a thread safe collection.If it finds a condition where a dp6lag is true and a&hannelData0bect3s 4oltage +e"el is abo"e the threshold' it willcause an alarm to be thrown to the uiManager and SoundAlarm.

    3..2 $omponent /ui-%ser"er interface description.

    Inputs1 &hannelData0bect' dp6lag

    0utputs1 4isual Alarm' Audible Alarm

  • 8/16/2019 SDS doc

    7/10

    3. Description for $omponent /uiManager 

    uiManager is used to create and show the ui on the screen. It is themain entry point for the operator.

    3..1 #rocessing narrati"e S#'$( for component/uiManager 

    GuiManaer will use ava Swin com#onents to dis#lay theGui on the o#erator-s screen. %his com#onent will containa %et area that will dis#lay ChannelDataObjects in realtime. %he o#erator can invo/e or terminate a scan that willstart or sto# SerialCommSubject +rom #ollin the serial#ort. %he o#erator can also load a #revious scan-s data.

    3..2 $omponent /uiManager interface description.

    Inputs1 0perator mouse and !eyboard e"ents

    0utputs1 &hannelData0bect information in human readableformat.

    3. Description for $omponent )dp'ternalMotionSu%ject

    dp8,ternalMotionSubect is responsible for opening and continuouslypolling an dp port to listen for dp6lags.

    3..1 #rocessing narrati"e S#'$( for component)dp'ternalMotionSu%ject

    "d#0ternalMotionSubject will continuously monitor "d##ort 1122 +or a 3a sent by a third #arty #roram. %his3a re#resents weather or not motion at the current timedurin a scan is trivial or non(trivial. %hese 3as are thensent to the GuiObserver.

    3..2 $omponent )dp'ternalMotionSu%ject interface

    description.

    Inputs1 dp pac!et

    0utputs1 dp6lag

  • 8/16/2019 SDS doc

    8/10

    3.10 Description for $omponent ile4ogger-%ser"er 

    6ile+ogger0bser"er will log all &hannelData0bects and dp6lags for agi"en scan.

    3.10.1 #rocessing narrati"e S#'$( for componentile4ogger-%ser"er 

    $ile!oerObserver will create a uni4ue fle at thebeinnin o+ each scan. 5t will then store allChanelDataObjects and "d#$las +or that scan in the fle. %hey will be in tet +ormat6

    3.10.2 $omponent ile4ogger-%ser"er interface description.

    Inputs1 &hannelData0bects' dp6lags

    0utputs1 6ile containing all &hannelData0bects and dp6lags fora gi"en scan

     3.11 Software Interface Description

    The software interface(s)to the outside world is(are) described.

     3.11.1 'ternal macine interfaces

    This application will be connected to a 6reescale $&S5-Microcontroller nit (M& through a RS#-- interface (D9:&onnector). This M& is part of the MMDS $ardware to SoftwareInterface that con"erts TT+ le"el "oltages to RS#-- "oltages andmar!s them with a timestamp and channel data.

     3.11.2 'ternal s5stem interfaces

    This application will be e,posing D/ port ;;:: to listen for dataregarding non#tri"ial motion. This interface is e,posed to listen fordata sent from another program written to determine e,act times

    during an MRI scan when motion will cause image artifacts.

  • 8/16/2019 SDS doc

    9/10

    *.0 )ser interface design

     A description of the user interface design of the software is presented.

    *.1 Description of te user interface

    The user interface is built using 7a"a3s Swing &omponents. MMDS usesDa"id 8!holm3s Ri"er+ayout as a +ayout Manager.

    *.1.1 Screen images

    *.1.2 -%jects and actions

    Te,tArea1 sed to display &hannelData0bects "oltage' time' andchannel data.

    Start Scan 9utton1 sed to cause MMDS to start scanning serialport

    Stop Scan 9utton1 sed to cause MMDS to stop scanning serialport

    4iew +og 9utton1 sed to load a pre"ious scan3s data.

  • 8/16/2019 SDS doc

    10/10

    +.0 6esting Issues

    Test strategy and preliminary test case specification are presented in this section.

    +.1 $lasses of tests

    +.1.1 6iming

    The MMDS will be tested using the M&&ommSim &omponent.M&&ommSim will send RS#-- Strings. 8mphasis will be placed onboth high#speed data and "arying time inter"als.

    +.1.2 Image Artifacts

    Images generated from the MRI will undergo separate performance

    e"aluation. This will in"ol"e measuring the standard de"iation of groups of pi,els along the borders of the images.

    +.2 'pected software response

    +.2.1 6iming

    MMDS is e,pected to e,perience some sort of delay from the time a&hannelData0bect is created to when it is displayed to the 0perator. It ise,pected that after a < minute scan' the delay will be no longer than 5second.

    +.2.2 6iming

    The standard de"iation of the pi,els on the borders of the image should belower than images with !nown motion artifacts.

    +.3 #erformance %ounds

    The audible and "isual alarm should be a"ailable within 5 second after theRS#-- String is sent to the serial port. 

    ,.0 Appendices

    /resents information that supplements the design specification.

    ,.1 #ackaging and installation issues

    /roect will be pac!aged into a single ar using Apache Ant.