⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dcddirif.h

📁 转化为DIB位图再显示出来的dicom文件C++代码
💻 H
📖 第 1 页 / 共 5 页
字号:
                                                const OFString &referencedFileID,                                                const OFString &sourceFilename);    /** create new fiducial record and copy required values from dataset     *  @param dataset DICOM dataset of the current file     *  @param referencedFileID value of the Referenced File ID attribute     *  @param sourceFilename name of the source DICOM file     *  @return pointer to new record, NULL if an error occurred     */    DcmDirectoryRecord *buildFiducialRecord(DcmItem *dataset,                                            const OFString &referencedFileID,                                            const OFString &sourceFilename);    /** create new raw data record and copy required values from dataset     *  @param dataset DICOM dataset of the current file     *  @param referencedFileID value of the Referenced File ID attribute     *  @param sourceFilename name of the source DICOM file     *  @return pointer to new record, NULL if an error occurred     */    DcmDirectoryRecord *buildRawDataRecord(DcmItem *dataset,                                           const OFString &referencedFileID,                                           const OFString &sourceFilename);    /** create new spectroscopy record and copy required values from dataset     *  @param dataset DICOM dataset of the current file     *  @param referencedFileID value of the Referenced File ID attribute     *  @param sourceFilename name of the source DICOM file     *  @return pointer to new record, NULL if an error occurred     */    DcmDirectoryRecord *buildSpectroscopyRecord(DcmItem *dataset,                                                const OFString &referencedFileID,                                                const OFString &sourceFilename);    /** create new encap doc record and copy required values from dataset     *  @param dataset DICOM dataset of the current file     *  @param referencedFileID value of the Referenced File ID attribute     *  @param sourceFilename name of the source DICOM file     *  @return pointer to new record, NULL if an error occurred     */    DcmDirectoryRecord *buildEncapDocRecord(DcmItem *dataset,                                            const OFString &referencedFileID,                                            const OFString &sourceFilename);    /** create new value map record and copy required values from dataset     *  @param dataset DICOM dataset of the current file     *  @param referencedFileID value of the Referenced File ID attribute     *  @param sourceFilename name of the source DICOM file     *  @return pointer to new record, NULL if an error occurred     */    DcmDirectoryRecord *buildValueMapRecord(DcmItem *dataset,                                            const OFString &referencedFileID,                                            const OFString &sourceFilename);    /** create new image record and copy required values from dataset     *  @param dataset DICOM dataset of the current file     *  @param referencedFileID value of the Referenced File ID attribute     *  @param sourceFilename name of the source DICOM file     *  @return pointer to new record, NULL if an error occurred     */    DcmDirectoryRecord *buildImageRecord(DcmItem *dataset,                                         const OFString &referencedFileID,                                         const OFString &sourceFilename);    /** create new hanging protocol record and copy required values from dataset     *  @param dataset DICOM dataset of the current file     *  @param referencedFileID value of the Referenced File ID attribute     *  @param sourceFilename name of the source DICOM file     *  @return pointer to new record, NULL if an error occurred     */    DcmDirectoryRecord *buildHangingProtocolRecord(DcmItem *dataset,                                                   const OFString &referencedFileID,                                                   const OFString &sourceFilename);    /** create icon image from given PGM (portable gray map) file.     *  Please note that only grayscale images in binary format are currently     *  supported (magic word "P5").  Memory has to be allocated by the caller.     *  @param filename name of the PGM file to be loaded     *  @param pixel pointer to memory buffer where the pixel data are to be stored     *  @param count number of bytes allocated for the 'pixel' memory buffer     *  @param width width of the scaled icon image (in pixels )     *  @param height height of the scaled icon image (in pixels)     *  @return OFTrue if successful, OFFalse otherwise     */    OFBool getIconFromFile(const OFString &filename,                           Uint8 *pixel,                           const unsigned long count,                           const unsigned int width,                           const unsigned int height);    /** create icon image from DICOM dataset.     *  Please note that the memory buffer has to be allocated by the caller.     *  @param dataset DICOM dataset from which the icon image is created     *  @param pixel pointer to memory buffer where the pixel data are to be stored     *  @param count number of bytes allocated for the 'pixel' memory buffer     *  @param width width of the scaled icon image (in pixels )     *  @param height height of the scaled icon image (in pixels)     *  @return OFTrue if successful, OFFalse otherwise     */    OFBool getIconFromDataset(DcmItem *dataset,                              Uint8 *pixel,                              const unsigned long count,                              const unsigned int width,                              const unsigned int height);    /** add icon image sequence to DICOMDIR record.     *  If the icon image cannot be created from the DICOM dataset and there is no     *  PGM file specified (neither for the particular image not a default one) a     *  black image is used instead.     *  @param record DICOMDIR record where the icon image is stored     *  @param dataset DICOM dataset from which the icon image is possibly created     *  @param size resolution of the icon image to be created (width and height)     *  @param sourceFilename name of the source DICOM file     *  @return EC_Normal upon success, an error code otherwise     */    OFCondition addIconImage(DcmDirectoryRecord *record,                             DcmItem *dataset,                             const unsigned int size,                             const OFString &sourceFilename);    /** add child record to a given parent record.     *  A new record is only added if it does not already exist.     *  @param parent parent record (add new record as a child of this one)     *  @param recordType type of DICOMDIR record to be created     *  @param dataset DICOM dataset containing data of the new record     *  @param referencedFileID value of the Referenced File ID attribute     *  @param sourceFilename name of the source DICOM file     *  @return pointer to new/existing record, NULL if an error occurred     */    DcmDirectoryRecord *addRecord(DcmDirectoryRecord *parent,                                  const E_DirRecType recordType,                                  DcmItem *dataset,                                  const OFString &referencedFileID,                                  const OFString &sourceFilename);    /** invent missing type 1 attributes for all child records (from patient level)     *  @param parent invent missing attributes for all children of this record (root)     *  @param recurse invent missing attributes also for lower level records if OFTrue.     *    Only invent attributes for the top (patient) level if OFFalse.     */    void inventMissingAttributes(DcmDirectoryRecord *parent,                                 const OFBool recurse = OFTrue);    /** invent missing type 1 attributes for all child records (from study level)     *  @param parent invent missing attributes for all children of this record     */    void inventMissingStudyLevelAttributes(DcmDirectoryRecord *parent);    /** invent missing type 1 attributes for all child records (from series level)     *  @param parent invent missing attributes for all children of this record     */    void inventMissingSeriesLevelAttributes(DcmDirectoryRecord *parent);    /** invent missing type 1 attributes for all child records (from instance level)     *  @param parent invent missing attributes for all children of this record     */    void inventMissingInstanceLevelAttributes(DcmDirectoryRecord *parent);    /** create backup of a given file     *  @param filename name of the file to be backuped     */    void createDicomDirBackup(const char *filename);    /** delete backup file if one has been created     */    void deleteDicomDirBackup();    /** print a message on the log stream (stdout)     *  @param message message to be printed     *  @param suffix optional message suffix     */    void printMessage(const char *message,                      const char *suffix = NULL);    /** print a warning message on the log stream (stderr).     *  The prefix "Warning: " is printed automatically.     *  @param message warning message to be printed     *  @param suffix optional message suffix     */    void printWarningMessage(const char *message,                             const char *suffix = NULL);    /** print an error message on the log stream (stderr).     *  The prefix "Error: " is printed automatically.     *  @param message error message to be printed     *  @param suffix optional message suffix     */    void printErrorMessage(const char *message,                           const char *suffix = NULL);    /** print a message that the value of a given tag is unexpected.     *  The output format is: "{Error|Warning}: attribute <key.tagName()> <key>     *  has other value than expected[ in file: <filename>]"     *  @param key affected tag     *  @param filename name of the file (optional, might be NULL)     *  @param errorMsg print error message if OFTrue, a warning message otherwise     */    void printUnexpectedValueMessage(const DcmTagKey &key,                                     const char *filename = NULL,                                     const OFBool errorMsg = OFTrue);    /** print an error message that a required attribute is missing/empty.     *  The output format is: "Error: <error.text()>: required attribute <key.tagName()>     *  <key> {empty|missing}[ in file: <filename>]"     *  @param key affected tag     *  @param filename name of the file (optional, might be NULL)     *  @param emptyMsg print "empty" if OFTrue, "missing" otherwise     */    void printRequiredAttributeMessage(const DcmTagKey &key,                                       const char *filename = NULL,                                       const OFBool emptyMsg = OFFalse);    /** print an error message that something went wrong with an attribute.     *  The output format is: "Error: <error.text()>: [cannot <operation> ]<key.tagName()>     *  <key>"     *  @param key affected tag     *  @param error status to be reported (only if ".bad()")     *  @param operation name of the operation that failed (optional, might be NULL)     */    void printAttributeErrorMessage(const DcmTagKey &key,                                    const OFCondition &error,                                    const char *operation);    /** print an error message that something went wrong with a given record.     *  The output format is: "Error: <error.text()>: [cannot <operation> ]<recordType>     *  directory record"     *  @param error status to be reported (only if ".bad()")     *  @param recordType type of DICOMDIR record which caused the error     *  @param operation name of the operation that failed (optional, might be NULL)     */    void printRecordErrorMessage(const OFCondition &error,                                 const E_DirRecType recordType,                                 const char *operation);    /** print the given error status to the log stream (stderr).     *  The output format is: "Error: <error.text()>: [<operation> ][file: <filename>]"     *  @param error status to be reported (only if ".bad()")     *  @param operation name of the operation that failed (optional, might be NULL)     *  @param filename name of the file (optional, might be NULL)     */    void printFileErrorMessage(const OFCondition &error,                               const char *operation,                               const char *filename);    /** copy contents of specified file     *  @param fromFilename name of the file to be copied     *  @param toFilename name of the new file (copy of 'fromFilename')     *  @return OFTrue if successful, OFFalse otherwise     */    OFBool copyFile(const char *fromFilename,                    const char *toFilename);    /** see if all the attributes in record match the values in dataset and warn if not     *  @param record directory record to be checked     *  @param dataset DICOM dataset to be compared with the directory record     *  @param sourceFilename name of the source DICOM file     *  @param abortCheck flag indicating whether to abort on the first inconsistent record     *  @return OFTrue in case of any inconsistency, OFFalse otherwise     */    OFBool warnAboutInconsistentAttributes(DcmDirectoryRecord *record,                                           DcmItem *dataset,                                           const OFString &sourceFilename,                                           const OFBool abortCheck = OFFalse);    /** check whether given fileset ID is valid     *  @param filesetID fileset ID to be checked     *  @return OFTrue if ID is valid, OFFalse otherwise     */    OFBool checkFilesetID(const OFString &filesetID);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -