diff --git a/pypulseq/Sequence/block.py b/pypulseq/Sequence/block.py index d7c3035..38ceacd 100755 --- a/pypulseq/Sequence/block.py +++ b/pypulseq/Sequence/block.py @@ -333,8 +333,6 @@ def get_block(self, block_index: int) -> SimpleNamespace: # ADC if event_ind[5] > 0: lib_data = self.adc_library.data[event_ind[5]] - if len(lib_data) < 6: - lib_data = np.concatenate((lib_data, [0])) adc = SimpleNamespace() ( diff --git a/pypulseq/Sequence/read_seq.py b/pypulseq/Sequence/read_seq.py index 7c3c65d..6e3d054 100755 --- a/pypulseq/Sequence/read_seq.py +++ b/pypulseq/Sequence/read_seq.py @@ -165,7 +165,7 @@ def read(self, path: str, detect_rf_use: bool = False) -> None: ) elif section == "[ADC]": self.adc_library = __read_events( - input_file, (1, 1e-9, 1e-6, 1, 1), event_library=self.adc_library + input_file, (1, 1e-9, 1e-6, 1, 1), event_library=self.adc_library, append=self.system.adc_dead_time ) elif section == "[DELAYS]": if version_combined >= 1004000: @@ -469,6 +469,7 @@ def __read_events( scale: tuple = (1,), event_type: str = str(), event_library: EventLibrary = EventLibrary(), + append=None ) -> EventLibrary: """ Read an event section of a sequence file and return a library of events. @@ -494,7 +495,9 @@ def __read_events( while line != "" and line != "#": data = np.fromstring(line, dtype=float, sep=" ") event_id = data[0] - data = data[1:] * scale + data = tuple(data[1:] * scale) + if append != None: + data = data + (append,) if event_type == "": event_library.insert(key_id=event_id, new_data=data) else: