Skip to content

Commit 26eb349

Browse files
fix(import): set xml_tform to None if importing xml with no img data
1 parent 366f4e1 commit 26eb349

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

PyReconstruct/modules/backend/func/xml_json_conversions.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,19 +201,22 @@ def sectionXMLtoJSON(section_fp, alignment_dict, hidden_dir):
201201
image = xml_section.images[0] # assume only one image
202202
else:
203203
image = None
204-
204+
205205
if image:
206+
206207
section_dict["src"] = image.src
207208
section_dict["mag"] = image.mag
208209
xml_tform = image.transform
209210
tform = Transform(
210211
list(xml_tform.tform()[:2,:].reshape(6))
211212
)
213+
212214
else:
215+
213216
print(f"Section: {fname} does not contain any image data.")
214217
section_dict["src"] = ""
215218
section_dict["mag"] = 0.00254
216-
xml_tform = XMLTransform(xcoef=[1, 0, 0, 0, 0, 0], ycoef=[0, 1, 0, 0, 0, 0])
219+
xml_tform = None
217220
tform = Transform.identity()
218221

219222
# get thickness

0 commit comments

Comments
 (0)