File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
monailabel/datastore/utils Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -504,14 +504,14 @@ def transcode_dicom_to_htj2k(
504504 ts_str = str (current_ts )
505505
506506 # Check if this transfer syntax should be skipped
507- if ts_str in skip_transfer_syntaxes :
507+ has_pixel_data = hasattr (ds , "PixelData" ) and ds .PixelData is not None
508+ if ts_str in skip_transfer_syntaxes or not has_pixel_data :
508509 skip_batch .append (idx )
509- logger .info (f" Skipping { os .path .basename (batch_in [idx ])} (Transfer Syntax: { ts_str } )" )
510+ logger .info (f" Skipping { os .path .basename (batch_in [idx ])} (Transfer Syntax: { ts_str } , has_pixel_data: { has_pixel_data } )" )
510511 continue
511512
513+ assert has_pixel_data , f"DICOM file { os .path .basename (batch_in [idx ])} does not have a PixelData member"
512514 if ts_str in NVIMGCODEC_SYNTAXES :
513- if not hasattr (ds , "PixelData" ) or ds .PixelData is None :
514- raise ValueError (f"DICOM file { os .path .basename (batch_in [idx ])} does not have a PixelData member" )
515515 nvimgcodec_batch .append (idx )
516516 else :
517517 pydicom_batch .append (idx )
You can’t perform that action at this time.
0 commit comments