Skip to content

Commit

Permalink
Merge pull request #46 from Donders-Institute/development
Browse files Browse the repository at this point in the history
DPX addition + SC compatibility
  • Loading branch information
MaCuinea authored Dec 17, 2024
2 parents ec4c629 + 6519205 commit ffa11eb
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 20 deletions.
17 changes: 14 additions & 3 deletions fus_ds_package/fus_driving_systems/config/create_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
config['Equipment.Manufacturer.SC']['Equipment - Driving systems'] = '\n'.join(SC_DS)

SC_TRAN_2CH = ['CTX-250-009', 'CTX-250-014', 'CTX-500-006']
SC_TRAN_4CH = ['CTX-250-001', 'CTX-250-026', 'CTX-500-024', 'CTX-500-026']
SC_TRAN_4CH = ['CTX-250-001', 'CTX-250-026', 'CTX-500-024', 'CTX-500-026', 'DPX-500-022']

SC_TRANS = SC_TRAN_2CH + SC_TRAN_4CH

Expand Down Expand Up @@ -199,7 +199,7 @@
+ 'junior ' + SC_DS[0])
config['Equipment.Driving system.' + SC_DS[0]]['Manufacturer'] = SONIC_CONCEPTS
config['Equipment.Driving system.' + SC_DS[0]]['Available channels'] = str(4)
config['Equipment.Driving system.' + SC_DS[0]]['Connection info'] = 'COM7'
config['Equipment.Driving system.' + SC_DS[0]]['Connection info'] = 'COM6'
config['Equipment.Driving system.' + SC_DS[0]]['Transducer compatibility'] = str('\n'.join(
SC_TRANS + DUMMIES))
config['Equipment.Driving system.' + SC_DS[0]]['Active?'] = str(True)
Expand All @@ -209,7 +209,7 @@
+ 'senior ' + SC_DS[1])
config['Equipment.Driving system.' + SC_DS[1]]['Manufacturer'] = SONIC_CONCEPTS
config['Equipment.Driving system.' + SC_DS[1]]['Available channels'] = str(4)
config['Equipment.Driving system.' + SC_DS[1]]['Connection info'] = 'COM8'
config['Equipment.Driving system.' + SC_DS[1]]['Connection info'] = 'COM5'
config['Equipment.Driving system.' + SC_DS[1]]['Transducer compatibility'] = str('\n'.join(
SC_TRANS + DUMMIES))
config['Equipment.Driving system.' + SC_DS[1]]['Active?'] = str(True)
Expand Down Expand Up @@ -484,6 +484,17 @@
'CTX-500-026 - TPO-105-010 - Steer Table.xlsx')) # should be in the same directory as code
config['Equipment.Transducer.' + SC_TRANS[6]]['Active?'] = str(True)

config['Equipment.Transducer.' + SC_TRANS[7]] = {}
config['Equipment.Transducer.' + SC_TRANS[7]]['Name'] = 'NeuroFUS 4 ch. DPX-500-022'
config['Equipment.Transducer.' + SC_TRANS[7]]['Manufacturer'] = SONIC_CONCEPTS
config['Equipment.Transducer.' + SC_TRANS[7]]['Elements'] = str(4)
config['Equipment.Transducer.' + SC_TRANS[7]]['Fund. freq.'] = str(500) # [kHz]
config['Equipment.Transducer.' + SC_TRANS[7]]['Natural focus'] = str(0) # [mm] only for Imasonic
config['Equipment.Transducer.' + SC_TRANS[7]]['Exit plane - first element dist.'] = str(0) # [mm] only for Imasonic
config['Equipment.Transducer.' + SC_TRANS[7]]['Min. focus'] = str(0) # [mm], wrt exit plane
config['Equipment.Transducer.' + SC_TRANS[7]]['Max. focus'] = str(120) # [mm], wrt exit plane
config['Equipment.Transducer.' + SC_TRANS[7]]['Steer information'] = '' # should be in the same directory as code
config['Equipment.Transducer.' + SC_TRANS[7]]['Active?'] = str(True)

#######################################################################################
# Imasonic - Tranducers
Expand Down
24 changes: 22 additions & 2 deletions fus_ds_package/fus_driving_systems/config/ds_config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ transducers = CTX-250-009
CTX-250-026
CTX-500-024
CTX-500-026
DPX-500-022
IS_PCD15287_01001
IS_PCD15287_01002
IS_PCD15473_01001
Expand Down Expand Up @@ -91,6 +92,7 @@ equipment - transducers = CTX-250-009
CTX-250-026
CTX-500-024
CTX-500-026
DPX-500-022

[Equipment.Manufacturer.IGT]
name = IGT
Expand Down Expand Up @@ -125,29 +127,31 @@ equipment - transducers = IS_PCD15287_01001
name = NeuroFUS 1 x 4 ch. or 1 x 2 ch. TPO junior 203-035
manufacturer = Sonic Concepts
available channels = 4
connection info = COM7
connection info = COM6
transducer compatibility = CTX-250-009
CTX-250-014
CTX-500-006
CTX-250-001
CTX-250-026
CTX-500-024
CTX-500-026
DPX-500-022
Dummy
active? = True

[Equipment.Driving system.105-010]
name = NeuroFUS 1 x 4 ch. or 1 x 2 ch. TPO senior 105-010
manufacturer = Sonic Concepts
available channels = 4
connection info = COM8
connection info = COM5
transducer compatibility = CTX-250-009
CTX-250-014
CTX-500-006
CTX-250-001
CTX-250-026
CTX-500-024
CTX-500-026
DPX-500-022
Dummy
active? = True

Expand Down Expand Up @@ -192,6 +196,7 @@ transducer compatibility = CTX-250-001
CTX-250-026
CTX-500-024
CTX-500-026
DPX-500-022
Dummy
active? = False

Expand All @@ -207,6 +212,7 @@ transducer compatibility = CTX-250-009
CTX-250-026
CTX-500-024
CTX-500-026
DPX-500-022
Dummy
active? = False

Expand Down Expand Up @@ -262,6 +268,7 @@ transducer compatibility = CTX-250-001
CTX-250-026
CTX-500-024
CTX-500-026
DPX-500-022
Dummy
active? = False

Expand All @@ -274,6 +281,7 @@ transducer compatibility = CTX-250-001
CTX-250-026
CTX-500-024
CTX-500-026
DPX-500-022
Dummy
active? = False

Expand Down Expand Up @@ -383,6 +391,18 @@ max. focus = 79.6
steer information = igt\config\sonic_concepts_transducers\CTX-500-026 - TPO-105-010 - Steer Table.xlsx
active? = True

[Equipment.Transducer.DPX-500-022]
name = NeuroFUS 4 ch. DPX-500-022
manufacturer = Sonic Concepts
elements = 4
fund. freq. = 500
natural focus = 0
exit plane - first element dist. = 0
min. focus = 0
max. focus = 120
steer information =
active? = True

[Equipment.Transducer.IS_PCD15287_01001]
name = Imasonic 10 ch. PCD15287_01001 ROC 75 mm
manufacturer = Imasonic
Expand Down
21 changes: 16 additions & 5 deletions fus_ds_package/fus_driving_systems/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,22 +252,22 @@ def __init__(self):
self._timing_param = {
# # Pulse
'pulse_dur': 0.25, # [ms]
'pulse_rep_int': 200, # [ms]
'pulse_rep_int': 20, # [ms]

# Rectangular - no ramping, Linear, Tukey
'pulse_ramp_shape': config['General']['Ramp shapes'].split('\n')[0],
'pulse_ramp_dur': 0, # [ms]

# # Pulse train
'pulse_train_dur': 200, # [ms]
'pulse_train_rep_int': 200, # [ms]
'pulse_train_dur': 20, # [ms]
'pulse_train_rep_int': 20, # [ms]

# Rectangular - no ramping, Linear, Tukey
# 'pulse_train_ramp_shape': config['General']['Ramp shapes'].split('\n')[0],
# 'pulse_train_ramp_dur': 0, # [ms]

# Pulse train repetition
'pulse_train_rep_dur': 200, # [ms]
'pulse_train_rep_dur': 20, # [ms]

# Rectangular - no ramping, Linear, Tukey
# 'pulse_train_rep_ramp_shape': config['General']['Ramp shapes'].split('\n')[0],
Expand Down Expand Up @@ -498,6 +498,12 @@ def n_triggers(self, n_triggers):
True, True, True, False)
if is_validated:
self._n_triggers = n_triggers

# set temporarily the pulse train repetition parameters equal to
# the pulse train duration to prevent default being lower than
# pulse train duration
self.pulse_train_rep_int = self.pulse_train_dur
self.pulse_train_rep_dur = self.pulse_train_dur

@property
def transducer(self):
Expand Down Expand Up @@ -1460,7 +1466,12 @@ def pulse_train_dur(self, pulse_train_dur):
True, True, True, False)
if is_validated:
self._timing_param['pulse_train_dur'] = pulse_train_dur


if self._driving_sys.manufact == config['Equipment.Manufacturer.SC']['Name']:
# SC doesn't have a pulse train repetition definition so set to None

self._timing_param['pulse_train_rep_int'] = None
self._timing_param['pulse_train_rep_dur'] = None
@property
def pulse_train_rep_int(self):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def send_sequence(self, sequence):
self._reset_parameters()

self._set_operating_freq(sequence.oper_freq)
self._set_focus(sequence.focus_wrt_mid_bowl)
self._set_focus(sequence.focus_wrt_exit_plane)
self._set_global_power(sequence.global_power)
self._set_burst_and_period(sequence.pulse_dur, sequence.pulse_rep_int)
self._set_timer(sequence.pulse_train_dur)
Expand Down Expand Up @@ -176,7 +176,7 @@ def _send_command(self, command, sleep_time_s=1):
logger.info("Sent to gen: %s", command.strip())
time.sleep(sleep_time_s)
response = self.gen.readline().decode("ascii").rstrip()
logger.info("Response from gen: %response", response)
logger.info(f"Response from gen: {response}")

if response == 'E2':
logger.error("Error E2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
one_interleaved_session_ms = seq1.pulse_train_rep_dur + seq3.pulse_train_rep_dur
n_sessions = round(total_duration_s / (one_interleaved_session_ms/1000))
for i in range(n_sessions):
print(f'\n session {i} of {n_sessions} \n')
igt_driving_sys.execute_sequence(seq1, seq2)
igt_driving_sys.execute_sequence(seq3, seq4)

Expand Down
18 changes: 10 additions & 8 deletions standalone_driving_system_software/standalone_sonic_concepts.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
# import the 'fus_driving_systems - sequence' into your code
##############################################################################

import sys

from fus_driving_systems import driving_system, transducer
from fus_driving_systems import sequence

Expand All @@ -43,20 +45,20 @@
# equipment
# to check available driving systems: print(driving_system.get_ds_serials())
# choose one driving system from that list as input
seq.driving_sys = '203-035'
seq.driving_sys.connect_info = 'COM3' # COM port the driving system is connected to
seq.driving_sys = '105-010'
seq.driving_sys.connect_info = 'COM5' # COM port the driving system is connected to

# set wait_for_trigger to true if you want to use trigger
seq.wait_for_trigger = True
seq.wait_for_trigger = False

# to check available transducers: print(transducer.get_tran_serials())
# choose one transducer from that list as input
seq.transducer = 'CTX-250-009'
seq.transducer = 'CTX-500-026'

# set general parameters
seq.oper_freq = 250 # [kHz], operating frequency
seq.focus = 40 # [mm], focal depth
seq.global_power = 5 # [W], global power. NOTE: DIFFERENT THAN IGT
seq.oper_freq = 500 # [kHz], operating frequency
seq.focus_wrt_exit_plane = 40 # [mm], focal depth
seq.global_power = 2.5 # [W], global power. NOTE: DIFFERENT THAN IGT

# # timing parameters # #
# you can use the TUS Calculator to visualize the timing parameters:
Expand Down Expand Up @@ -104,7 +106,7 @@

from fus_driving_systems.sonic_concepts import sonic_concepts_ds

sc_ds = sonic_concepts_ds.SC()
sc_ds = sonic_concepts_ds.SonicConcepts()

try:
sc_ds.connect(seq.driving_sys.connect_info)
Expand Down

0 comments on commit ffa11eb

Please sign in to comment.