@@ -125,10 +125,8 @@ 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 (
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- )
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." )
132130 self .box_ref_image_keys = box_ref_image_keys
133131
134132 def __call__ (self , data : Mapping [Hashable , NdarrayOrTensor ]) -> dict [Hashable , NdarrayOrTensor ]:
@@ -289,10 +287,8 @@ def __init__(
289287 super ().__init__ (box_keys , allow_missing_keys )
290288 box_ref_image_keys_tuple = ensure_tuple (box_ref_image_keys )
291289 if len (box_ref_image_keys_tuple ) > 1 :
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- )
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." )
296292 self .box_ref_image_keys = box_ref_image_keys
297293 self .image_meta_key = image_meta_key or f"{ box_ref_image_keys } _{ image_meta_key_postfix } "
298294 self .converter_to_image_coordinate = AffineBox ()
@@ -310,10 +306,8 @@ def extract_affine(self, data: Mapping[Hashable, torch.Tensor]) -> tuple[Ndarray
310306 else :
311307 raise ValueError (f"{ meta_key } is not found. Please check whether it is the correct the image meta key." )
312308 if "affine" not in meta_dict :
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- )
309+ raise ValueError (f"'affine' is not found in { meta_key } . \
310+ Please check whether it is the correct the image meta key." )
317311 affine : NdarrayOrTensor = meta_dict ["affine" ]
318312
319313 if self .affine_lps_to_ras : # RAS affine
@@ -815,16 +809,12 @@ def __init__(
815809 ) -> None :
816810 box_keys_tuple = ensure_tuple (box_keys )
817811 if len (box_keys_tuple ) != 1 :
818- raise ValueError (
819- "Please provide a single key for box_keys.\
820- All label_keys are attached to this box_keys."
821- )
812+ raise ValueError ("Please provide a single key for box_keys.\
813+ All label_keys are attached to this box_keys." )
822814 box_ref_image_keys_tuple = ensure_tuple (box_ref_image_keys )
823815 if len (box_ref_image_keys_tuple ) != 1 :
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- )
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." )
828818 self .label_keys = ensure_tuple (label_keys )
829819 super ().__init__ (box_keys_tuple , allow_missing_keys )
830820
@@ -1091,10 +1081,8 @@ def __init__(
10911081
10921082 box_keys_tuple = ensure_tuple (box_keys )
10931083 if len (box_keys_tuple ) != 1 :
1094- raise ValueError (
1095- "Please provide a single key for box_keys.\
1096- All label_keys are attached to this box_keys."
1097- )
1084+ raise ValueError ("Please provide a single key for box_keys.\
1085+ All label_keys are attached to this box_keys." )
10981086 self .box_keys = box_keys_tuple [0 ]
10991087 self .label_keys = ensure_tuple (label_keys )
11001088
0 commit comments