import sys,os,stat
import gdcm
blacklist = (
"_j2k" "_jp2" "treamimpl" "TestDriver"
"ByteBuffer" "ExplicitDataElement"
"CP246ExplicitDataElement"
"ImplicitDataElement"
"Element"
"ValueIO"
"ParseException"
"ByteSwapFilter"
"ExplicitImplicitDataElement"
"UNExplicitDataElement"
"UNExplicitImplicitDataElement"
"Attribute"
"VR16ExplicitDataElement"
"LO" "String"
"CodeString"
"Parser"
"TagToVR"
"TagToType"
"GroupDict"
"DictConverter"
"Tables"
"MacroEntry"
"XMLDictReader"
"TableReader"
"Table"
"XMLPrivateDictReader"
"Configure"
"LegacyMacro"
"Swapper"
"SmartPointer"
"Win32"
"StaticAssert"
"DeflateStream"
"Types"
"Exception"
"ByteSwap"
"Terminal"
"CryptoFactory"
"CAPICryptoFactory"
"CAPICryptographicMessageSyntax"
"FileNameEvent"
"OpenSSLCryptoFactory"
"OpenSSLCryptographicMessageSyntax"
"OpenSSLP7CryptoFactory"
"OpenSSLP7CryptographicMessageSyntax"
"TagKeywords"
"ConstCharWrapper"
"ImageConverter"
"SerieHelper"
"JPEG8Codec"
"JPEG12Codec"
"JPEG16Codec"
"JPEG2000Codec"
"Segment"
"SegmentHelper"
"SegmentReader"
"SegmentWriter"
"MeshPrimitive"
"Surface"
"SurfaceHelper"
"SurfaceReader"
"SurfaceWriter"
"ImageCodec"
"DeltaEncodingCodec"
"RLECodec"
"RAWCodec"
"AudioCodec"
"EncapsulatedDocument"
"JPEGCodec"
"PVRGCodec"
"KAKADUCodec"
"JPEGLSCodec"
"PNMCodec"
"PGXCodec"
"PDFCodec"
"Decoder"
"Coder"
"ImageChangePhotometricInterpretation"
"IconImage" "StreamImageReader"
"StreamImageWriter"
"IconImageFilter"
"IconImageGenerator"
"DirectoryHelper"
"DataEvent"
"DataSetEvent"
"ApplicationContext"
"AAssociateRJPDU"
"AAssociateACPDU"
"ULBasicCallback"
"ULActionDT"
"ULActionAA"
"QueryPatient"
"ULActionAE"
"ImplementationVersionNameSub"
"NetworkStateID"
"AReleaseRQPDU"
"MoveStudyRootQuery"
"ULConnectionCallback"
"NetworkEvents"
"QueryImage"
"ULEvent"
"PresentationContextRQ"
"PDataTFPDU"
"PresentationContextAC"
"DIMSE"
"PresentationContextGenerator"
"AAssociateRQPDU"
"ImplementationUIDSub"
"ULConnection"
"PresentationContext"
"QueryStudy"
"MovePatientRootQuery"
"CEchoMessages"
"QueryFactory"
"ULConnectionManager"
"ULConnectionInfo"
"MaximumLengthSub"
"TransferSyntaxSub"
"ARTIMTimer"
"AbstractSyntax"
"CFindMessages"
"AsynchronousOperationsWindowSub"
"ImplementationClassUIDSub"
"UserInformation"
"CMoveMessages"
"PDUFactory"
"CStoreMessages"
"FindStudyRootQuery"
"AAbortPDU"
"BaseCompositeMessage"
"ULActionAR"
"AReleaseRPPDU"
"ULTransitionTable"
"PresentationDataValue"
"BasePDU"
"QuerySeries"
"ULAction"
"ULWritingCallback"
"CompositeMessageFactory"
"CommandDataSet"
"RoleSelectionSub"
"SOPClassExtendedNegociationSub"
"FindPatientRootQuery"
"ServiceClassApplicationInformation"
"ModalityPerformedProcedureStepSetQuery"
"NormalizedMessageFactory"
"NormalizedNetworkFunctions"
"NSetMessages"
"WLMFindQuery"
"ModalityPerformedProcedureStepCreateQuery"
"BaseNormalizedMessage"
"NCreateMessages"
"NActionMessages"
"NGetMessages"
"BaseQuery"
"NEventReportMessages"
"NDeleteMessages"
)
def processonedir(dirname):
gdcmclasses = dir(gdcm)
subtotal = 0
for file in os.listdir(dirname):
if file[-2:] != '.h': continue
gdcmclass = file[4:-2]
if gdcmclass in gdcmclasses:
print("ok:", gdcmclass)
else:
if not gdcmclass in blacklist:
print("not wrapped:",gdcmclass)
subtotal += 1
return subtotal
if __name__ == "__main__":
dirname = os.sys.argv[1]
total = 0
for d in os.listdir(dirname):
if d == '.svn': continue
pathname = os.path.join(dirname, d)
mode = os.stat(pathname)[stat.ST_MODE]
if stat.S_ISDIR(mode):
print("processing directory:", pathname)
total += processonedir(pathname)
print("number of class not wrap:%d"%total)
sys.exit(total)