Do you have a question?

First Name:
Surname:
Email:
Phone:
Message:
Get Audio Code

How to add a new post-process to incoming series
Last Post 21 Feb 2013 10:09 PM by Steve Wranovsky. 1 Replies.
Printer Friendly
Sort:
NextNext
You are not authorized to post a reply.
Author Messages
Rob LUser is Offline
New Member
New Member
Posts:18

--
04 Feb 2013 02:25 PM  

 I'm trying to extend the image server to be able to do some processing on incoming series; ideally when a series has finished transmitting.  I have identified two extension points that could be appropriate for creating a plug-in of this sort.  I'd like some ideas and / or feedback about the best approach to take.  Here's what I've found so far:

ProcessorInsertExtensionPoint: a plug-in created from this extension point would be triggered every time an image is received and inserted into the database.  As far as I can tell, there is no additional work required to integrate the plug-in into the system.  However, since it operates on a per-image basis, the plug-in wouldn't know when the server thinks the series is done transmitting so it would have to guess when is the right time to process the series.  Polling the database with a query could take the guess-work out if I knew which query to use.

WorkQueueFactoryExtensionPoint: a plug-in created from this extension point might fit better within the image server workflow, but it appears to be more involved to code against this extension point because it wouldn't work in isolation; i.e. there would have to be rules set up to govern when tasks of this type are created / queued up (at least I think so).  So it's possible I'd have to modify the server's data model to allow for rules of a new type, etc.  I really don't know what's involved here - maybe it's easier than that.

Is either of these methods appropriate for the task?  Is one better than the other?  I'm leaning towards the first because it seems simpler.  Is there another better way I haven't identified?

My target is to deploy the plug-in to the plugins folder of the Team Edition Image Server, so I'm building my plug-in against that version of the CC code.

Thanks in advance!

- Rob

Steve WranovskyUser is Offline
Veteran Member
Veteran Member
Posts:2107

--
21 Feb 2013 10:09 PM  

Rob,

You're on the right track. The ProcessorExtensionPoint is used by us in some of our commercial code to modify/customize the insert into the database that's done with each image processed. One thing of note, this extension point is called within a database transaction. Any significant time spent in this extension could affect system performance.

The WorkQueueFactorExtensionPoint is really used for creating the processors for new WorkQueue entries. This could be used to implement a new type of Workqueue processor, but you're right, you'd still have to figure out some way to get the actual Work to be done into the database.

Another alternate would be to implement something through the rules engine, which is extensible. Ie, you could use this extension:

[ExtensionOf(typeof(XmlActionCompilerOperatorExtensionPoint))]

You can look in the CC.ImageServer.Rules assembly, and specifically at the folders within this assembly to see examples of the extension.  The CC.ImageServer.Rules.RleCodec also would be useful.  This extension defines the actual "actions" that are performed in rules.  There's a GetSchema() method to the extension that defines the "ServerRuleTypeEnum" that the action applies to, and also defines the valid XML schema for the rule.  The Compile() method of the extension returns an IActionItem that actually perfoms the action when a rule is applied.  There's a ServerActionContext passed to the IActionItem that gives the context of the study the rule is being applied to.

Anyways, if you were to define a ServerRuleTypeEnum.StudyCompress action, with the above extension, the action would be applied when a study has completed processing.  You could then perform your processing, or else trigger some other processing from this action.  There also may be an issue with an open database transaction, however, with this extension.  Anyways, this should be a feasible way to integrate in an extension during processing of a study.  

Finally, i was editing this study to add a note about doing future dev questions on github, when the forum software screwed up the post when I saved it after the edit.  Anyways, we're attempting to migrate dev questions there.

Steve

You are not authorized to post a reply.

Active Forums 4.1