DICOM (Digital Imaging and Communication in Medicine) is probably the most common standard used for storage and exchange of Medical Images. This article provides a basic introduction on reading a Dicom File using C#. The basic unit of a Dicom file is called an Element. Dicom Elements consists of 4 components 1. Tag 2. Value … Continue reading An Introduction into Dicom using Fellow Oak
Tag: C#
Parse Sub-Folders which do not contain specified file extension.
An easier way to parse for folders, which do not contain files with a specified extension.
Rethrow Exception
CA2200 : Rethrow to preserve stack details. That's one recommendation that as a developer you might have seen when running Code Analysis on your solution. So what does it mean ? What does the guilty code looks like and what is the correct way to throw exceptions. Lets start with incorrect code first. Considering following … Continue reading Rethrow Exception
Batch Execution in Firebird
Executing a .sql file on Firebird Database can be quite a messy job. The lack of proper documentation and support would hurt you more when encountered issues and that is what I faced when I required to do execute contends of a .Sql File. Having understood that FbBatchExecution is the command I would required, I went to … Continue reading Batch Execution in Firebird
Exception Handling in Web API (Part 2): Exception Filter (Extended)
The Exception Filter implementation mentioned in the Part1 of the article is fairly simple and straightforward. But as you start supporting more and more Exceptions, the Cyclomatic Complexity of the "OnException" method would increase because of the "if" condition nature. A cleaner implementation of the Filter is shown below using Dictionary. Isn't that cleaner ?
Exception Handling in Web API (Part 1): Exception Filter
The Web World, especially Web Services is fast moving towards the more abstract simpler Web API. This article is not focused on comparing Web Service and Web API, but rather it focuses on Exception Handling in Web API. By default, the most common exception that an API Controller raises are translated into an HTTP Status … Continue reading Exception Handling in Web API (Part 1): Exception Filter
Composite Primary Key using Data Annotations
When developing domain classes in Entity Framework using Code First Approach, the default code conventions creates a primary key of a property named "ID" or <ClassName>ID. But if you wanted to use another property as your primary key , you can use DataAnnotations and decorate the property using "Key" attribute. What is more interesting is … Continue reading Composite Primary Key using Data Annotations
Singleton using Lazy(T)
Singleton Design Pattern is probably the simplest and most straightforward design pattern. So instead of explaining further, let me get to the code. The whole idea behind the above implementation of Singleton is to make use of the Lazy(T) class provided by Framework 4.0 and provide a lazy initialized version of the pattern, in addition … Continue reading Singleton using Lazy(T)
Evil Code 0002 Optional Parameter Vs Method Overloading
Again one of those things which looks so simple, but could drive one mad during debugging. Much before Optional Parameters came in, C# developers used to depend on Method Overloading for mimicking Optional Parameters. Consider a scenario where both exists, what would be the output ? The output would be : The reason behind this … Continue reading Evil Code 0002 Optional Parameter Vs Method Overloading
Customized Debugger Tooltip
Code-Execute-Debug-Code-Execute-Debug.. This seems to be never ending cycle for any developer. Considerable amount of time of this cycle is spend in Debug phase, wherein user steps through breakpoints and traverse the objects and their properties. Thankfully, Microsoft has ensured that primitive types always shows the value, instead of any less-meaningful information. But what happens when … Continue reading Customized Debugger Tooltip