ANSI Color DICOM Dump :)

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Per
Posts: 99
Joined: Mon, 2007-09-03, 10:53
Location: Trondheim, Norway
Contact:

ANSI Color DICOM Dump :)

#1 Post by Per »

Hey. I love the new color option for the dcmdump output. I would like to request some small modifications, though, since I found values very hard to read the way it was set up currently.

A suggestion for a color dump that is easier to read:
diff --git a/dcmdata/include/dcmtk/dcmdata/dctypes.h b/dcmdata/include/dcmtk/dcmdata/dctypes.h
index d248dd3..1bf181c 100644
--- a/dcmdata/include/dcmtk/dcmdata/dctypes.h
+++ b/dcmdata/include/dcmtk/dcmdata/dctypes.h
@@ -66,11 +66,11 @@ OFLogger DCM_dcmdataGetLogger();
// ANSI escape codes for color output of the print() method
#define DCMDATA_ANSI_ESCAPE_CODE_RESET "\033[0m"
#define DCMDATA_ANSI_ESCAPE_CODE_TAG "\033[22m\033[32m"
-#define DCMDATA_ANSI_ESCAPE_CODE_VR "\033[22m\033[31m"
-#define DCMDATA_ANSI_ESCAPE_CODE_VALUE "\033[1m\033[37m"
-#define DCMDATA_ANSI_ESCAPE_CODE_INFO "\033[1m\033[30m"
+#define DCMDATA_ANSI_ESCAPE_CODE_VR "\033[22m\033[35m"
+#define DCMDATA_ANSI_ESCAPE_CODE_VALUE "\033[1m\033[30m"
+#define DCMDATA_ANSI_ESCAPE_CODE_INFO "\033[1m\033[34m"
#define DCMDATA_ANSI_ESCAPE_CODE_LENGTH "\033[22m\033[36m"
-#define DCMDATA_ANSI_ESCAPE_CODE_VM "\033[22m\033[35m"
+#define DCMDATA_ANSI_ESCAPE_CODE_VM "\033[22m\033[34m"
#define DCMDATA_ANSI_ESCAPE_CODE_NAME "\033[22m\033[33m"
#define DCMDATA_ANSI_ESCAPE_CODE_NAME_1 "\033[1m\033[33m"
#define DCMDATA_ANSI_ESCAPE_CODE_SEQUENCE "\033[22m\033[32m"
Though I reserve the right to change my mind and suggest something else later when I have had the time to get used to all the shiny colors ;-)

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

Thank you for the proposal. I also love the colored output of dcmdump and, therefore, I also added this nice feature to dsrdump :-)

The colored output of dcmdump was introduced quite late in the release cycle of DCMTK 3.6.0, so we decided to omit porting this feature to Windows (where ANSI escape codes do not work). We also thought about letting the user define his/her own colors by some other means than changing the code and recompiling. This is something that will be implemented sometime in the future ...

Of course, it should be noted that the display of the colors used on your console depend on the system you are using (see Wikipedia). I use "putty" on a Windows system in my office and the KDE Konsole at home. The colors look quite different ... However, on many systems the real colors used can be specified by mapping the limited set of ANSI colors to the corresponding RGB values.

Btw, I'm using the following alias in my shell:

Code: Select all

alias dcmdump='dcmdump +C'

Per
Posts: 99
Joined: Mon, 2007-09-03, 10:53
Location: Trondheim, Norway
Contact:

#3 Post by Per »

This is how it looks to me before the change: http://i55.tinypic.com/2qas3n8.png

Notice how the values are very hard to read.

This is how it looks here with my change: http://i52.tinypic.com/fvbbdj.jpg

I have a default Fedora 13 setup as far as terminal stuff go.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#4 Post by Jörg Riesmeier »

Ah, ok, you are using a white background. I prefer a black one :-)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest