@@ -13,13 +13,6 @@ def __init__(self, data_global, new_split_interest_points, self_definition, xml_
1313 self .xml_output_path = xml_output_path
1414
1515 def save_tile_attributes_to_xml (self , xml ):
16- """
17- Ensure the *last* <ViewSetups> (the outer split one) has:
18- - <Attributes name="illumination"> old_tile_0..N </Attributes>
19- - <Attributes name="channel"> ... </Attributes>
20- - <Attributes name="tile"> with locations from Image Splitting </Attributes>
21- - <Attributes name="angle"><Angle id=0 name=0/></Attributes>
22- """
2316 root = ET .fromstring (xml )
2417
2518 def tagname (el ):
@@ -249,26 +242,6 @@ def wrap_image_loader_for_split(self, xml: str) -> str:
249242 """
250243 Wrap the top-level ImageLoader in <ImageLoader format="split.viewerimgloader">
251244 and move the ORIGINAL ViewSetups/Timepoints/MissingViews into an inner
252- <SequenceDescription> inside that wrapper.
253-
254- Resulting structure:
255-
256- <SpimData>
257- <BasePath/>
258- <SequenceDescription>
259- <ImageLoader format="split.viewerimgloader">
260- <ImageLoader format="bdv.multimg.zarr"> ... </ImageLoader>
261- <SequenceDescription>
262- <ViewSetups> (ORIGINAL) </ViewSetups>
263- <Timepoints> (ORIGINAL) </Timepoints>
264- <MissingViews/>
265- </SequenceDescription>
266- <!-- SetupIds (for split tiles) will be added later -->
267- </ImageLoader>
268- <!-- NEW ViewSetups/Timepoints/MissingViews for split views are added later -->
269- </SequenceDescription>
270- <ViewRegistrations> ... </ViewRegistrations>
271- </SpimData>
272245 """
273246 root = ET .fromstring (xml )
274247
@@ -309,27 +282,22 @@ def find_one(tag):
309282 if fmt == 'split.viewerimgloader' :
310283 return xml
311284
312- # Collect any other ImageLoader siblings (other sources)
313- other_imageloaders = []
314285 # Collect ORIGINAL ViewSetups / Timepoints / MissingViews that are siblings
315286 orig_viewsetups = None
316287 orig_timepoints = None
317288 orig_missingviews = None
318289
319290 for ch in children [base_loader_idx + 1 :]:
320291 name = tn (ch )
321- if name == 'ImageLoader' :
322- other_imageloaders .append (ch )
323- elif name == 'ViewSetups' :
292+ if name == 'ViewSetups' :
324293 orig_viewsetups = ch
325294 elif name == 'Timepoints' :
326295 orig_timepoints = ch
327296 elif name == 'MissingViews' :
328297 orig_missingviews = ch
329-
330298
331299 # Remove them from the outer SequenceDescription
332- for node in (orig_viewsetups , orig_timepoints , orig_missingviews , * other_imageloaders ):
300+ for node in (orig_viewsetups , orig_timepoints , orig_missingviews ):
333301 if node is not None and node in seq :
334302 seq .remove (node )
335303
@@ -340,12 +308,9 @@ def find_one(tag):
340308 wrapper = ET .Element ('ImageLoader' , {'format' : 'split.viewerimgloader' })
341309 # First child: original loader
342310 wrapper .append (base_loader )
343- for other_loader in other_imageloaders :
344- wrapper .append (other_loader )
345311
346312 # Inner <SequenceDescription> that holds the original ViewSetups/Timepoints/MissingViews
347313 inner_seq = ET .Element ('SequenceDescription' )
348-
349314 if orig_viewsetups is not None :
350315 inner_seq .append (orig_viewsetups )
351316 if orig_timepoints is not None :
@@ -516,33 +481,6 @@ def find_one(tag):
516481 return ET .tostring (root , encoding = 'unicode' )
517482
518483 def save_setup_id_to_xml (self , xml ):
519- """
520- Create/overwrite the OUTER <ViewSetups> (split tiles) and ensure outer
521- <Timepoints> and <MissingViews> exist under the top-level SequenceDescription.
522-
523- Outer layout target:
524-
525- <SpimData>
526- <BasePath/>
527- <SequenceDescription>
528- <ImageLoader format="split.viewerimgloader">
529- ...
530- <SequenceDescription> (original) </SequenceDescription>
531- <SetupIds> ... </SetupIds> (from save_setup_id_definition_to_xml)
532- </ImageLoader>
533- <ViewSetups> <-- created here (ids 0..499)
534- <ViewSetup>...</ViewSetup>
535- ...
536- <Attributes ...>...</Attributes>
537- </ViewSetups>
538- <Timepoints type="pattern">
539- <integerpattern>0</integerpattern>
540- </Timepoints>
541- <MissingViews/>
542- </SequenceDescription>
543- <ViewRegistrations>...</ViewRegistrations>
544- </SpimData>
545- """
546484 root = ET .fromstring (xml )
547485
548486 def tn (el ):
0 commit comments