@@ -125,8 +125,10 @@ def __init__(self, box_keys: KeysCollection, box_ref_image_keys: str, allow_miss
125125 super ().__init__ (box_keys , allow_missing_keys )
126126 box_ref_image_keys_tuple = ensure_tuple (box_ref_image_keys )
127127 if len (box_ref_image_keys_tuple ) > 1 :
128- raise ValueError ("Please provide a single key for box_ref_image_keys.\
129- All boxes of box_keys are attached to box_ref_image_keys." )
128+ raise ValueError (
129+ "Please provide a single key for box_ref_image_keys.\
130+ All boxes of box_keys are attached to box_ref_image_keys."
131+ )
130132 self .box_ref_image_keys = box_ref_image_keys
131133
132134 def __call__ (self , data : Mapping [Hashable , NdarrayOrTensor ]) -> dict [Hashable , NdarrayOrTensor ]:
@@ -287,8 +289,10 @@ def __init__(
287289 super ().__init__ (box_keys , allow_missing_keys )
288290 box_ref_image_keys_tuple = ensure_tuple (box_ref_image_keys )
289291 if len (box_ref_image_keys_tuple ) > 1 :
290- raise ValueError ("Please provide a single key for box_ref_image_keys.\
291- All boxes of box_keys are attached to box_ref_image_keys." )
292+ raise ValueError (
293+ "Please provide a single key for box_ref_image_keys.\
294+ All boxes of box_keys are attached to box_ref_image_keys."
295+ )
292296 self .box_ref_image_keys = box_ref_image_keys
293297 self .image_meta_key = image_meta_key or f"{ box_ref_image_keys } _{ image_meta_key_postfix } "
294298 self .converter_to_image_coordinate = AffineBox ()
@@ -306,8 +310,10 @@ def extract_affine(self, data: Mapping[Hashable, torch.Tensor]) -> tuple[Ndarray
306310 else :
307311 raise ValueError (f"{ meta_key } is not found. Please check whether it is the correct the image meta key." )
308312 if "affine" not in meta_dict :
309- raise ValueError (f"'affine' is not found in { meta_key } . \
310- Please check whether it is the correct the image meta key." )
313+ raise ValueError (
314+ f"'affine' is not found in { meta_key } . \
315+ Please check whether it is the correct the image meta key."
316+ )
311317 affine : NdarrayOrTensor = meta_dict ["affine" ]
312318
313319 if self .affine_lps_to_ras : # RAS affine
@@ -809,12 +815,16 @@ def __init__(
809815 ) -> None :
810816 box_keys_tuple = ensure_tuple (box_keys )
811817 if len (box_keys_tuple ) != 1 :
812- raise ValueError ("Please provide a single key for box_keys.\
813- All label_keys are attached to this box_keys." )
818+ raise ValueError (
819+ "Please provide a single key for box_keys.\
820+ All label_keys are attached to this box_keys."
821+ )
814822 box_ref_image_keys_tuple = ensure_tuple (box_ref_image_keys )
815823 if len (box_ref_image_keys_tuple ) != 1 :
816- raise ValueError ("Please provide a single key for box_ref_image_keys.\
817- All box_keys and label_keys are attached to this box_ref_image_keys." )
824+ raise ValueError (
825+ "Please provide a single key for box_ref_image_keys.\
826+ All box_keys and label_keys are attached to this box_ref_image_keys."
827+ )
818828 self .label_keys = ensure_tuple (label_keys )
819829 super ().__init__ (box_keys_tuple , allow_missing_keys )
820830
@@ -1081,8 +1091,10 @@ def __init__(
10811091
10821092 box_keys_tuple = ensure_tuple (box_keys )
10831093 if len (box_keys_tuple ) != 1 :
1084- raise ValueError ("Please provide a single key for box_keys.\
1085- All label_keys are attached to this box_keys." )
1094+ raise ValueError (
1095+ "Please provide a single key for box_keys.\
1096+ All label_keys are attached to this box_keys."
1097+ )
10861098 self .box_keys = box_keys_tuple [0 ]
10871099 self .label_keys = ensure_tuple (label_keys )
10881100
0 commit comments