VRE Cancer Imaging BL RIC Workshop 22032011


Published on

Published in: Education
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • //Based on the algorithm from section 4.3 of http://www.ietf.org/rfc/rfc4122.txt public static Guid NameBasedGuid(string Group, string Element) { byte[] inputBytes = new byte[4];inputBytes[0] = Byte.Parse(Group.Substring(0, 2), System.Globalization.NumberStyles.HexNumber);inputBytes[1] = Byte.Parse(Group.Substring(2, 2), System.Globalization.NumberStyles.HexNumber);inputBytes[2] = Byte.Parse(Element.Substring(0, 2), System.Globalization.NumberStyles.HexNumber);inputBytes[3] = Byte.Parse(Element.Substring(2, 2), System.Globalization.NumberStyles.HexNumber); //Get an array of the input in byte form //byte[] inputBytes = Encoding.Default.GetBytes(input); //Prepare an array for the input bytes and the Namespace Guid byte[] concatenatedBytes = new byte[16 + inputBytes.Length]; //Copy the namespace id guid and the input sequence to a second array { //GuidNameSpaceID = new Guid("596bdb90-e5ad-4952-a904-dc47da78d260"); byte[] NamespaceIDBytes = new byte[] { 0x90,0xDB,0x6B,0x59,0xAD,0xE5,0x52,0x49,0xA9,0x04,0xDC,0x47,0xDA,0x78,0xD2,0x60 }; //GuidNameSpaceID = new Guid(NamespaceIDBytes);Array.Copy(NamespaceIDBytes, concatenatedBytes, 16);Array.Copy(inputBytes, 0, concatenatedBytes, 16, inputBytes.Length); } //Calculate the SHA1 hash of the second array - this gives us 20 bytes of which we use the first 16. SHA1CryptoServiceProvider SHAProvider = new SHA1CryptoServiceProvider(); byte[] hashBytes = SHAProvider.ComputeHash(concatenatedBytes); //Construct the guid byte[] GuidData = new byte[16]; //Copy across the first 16 bytes of the hashArray.Copy(hashBytes, GuidData, 16); //Special treatment is required for bytes 7 and 8 //In byte 7 the 4 most significant bits of the time_hi_and_version field need to be set to 1010 (small endian) //This is to set it to version 5 of the UUID as outlined in section 4.1.3. Note they are using big endian for their numbers. byte LowerMask_7 = 15; // 00001111 byte UpperBits_7 = 160; // 10100000 GuidData[7] &= LowerMask_7;GuidData[7] |= UpperBits_7; //Byte 8 has to have the two most significant bits (bits 6 and 7) of the //clock_seq_hi_and_reserved to zero and one, respectively. byte LowerMask_8 = 63; // 00111111 byte UpperBits_8 = 128; // 10000000 GuidData[8] &= LowerMask_8;GuidData[8] |= UpperBits_8;GuidhashGuid = new Guid(GuidData); return hashGuid; }
  • VRE Cancer Imaging BL RIC Workshop 22032011

    1. 1. A Virtual Research Environment for Cancer Imaging (VRE-CI)<br />British Library – RIC Workshop<br />22 March 2011<br />
    2. 2. Outline<br />VRE-CI Project<br />Manage Image Metadata<br />Using Business Connectivity Services (BCS)<br />Building the VRE-CI Site Template<br />
    3. 3. A Virtual Research Environment for Cancer Imaging (VRE-CI)<br /><ul><li>VRE-CIproject is funded by the Joint Information Systems Committee (JISC) to provide a framework to allow researchers and clinicians involved in Cancer Imaging to share information, images and algorithms.
    4. 4. JISC VRE frameworks phase 3.
    5. 5. 22 months 01/05/2009 – 21/02/2011.
    6. 6. Project Partner: Microsoft Research
    7. 7. Lee Dirks
    8. 8. Alex Wade
    9. 9. Roger Barga
    10. 10. Team members:
    11. 11. PI. Prof. Anne E. Trefethen
    12. 12. Co-I. Dr. Vicente Grau
    13. 13. Project Manager Dr. M. Susana Avila-Garcia.
    14. 14. Technical developers: Xin Xiong, Charles Crichton and Andrew Tsui.</li></li></ul><li>VRE-CI<br />VRE Toolkit for SP2010<br />
    15. 15. DICOM Image Viewer<br />
    16. 16. Manage Image Metadata<br />All of the images in the document set share the common metadata<br />
    17. 17. Manage Image Metadata<br />These fields are the Managed Terms which can be modified by users<br />
    18. 18. Manage Image Metadata<br />Managed Terms is stored in the Taxonomy Term Store in the Managed Metadata Service<br />
    19. 19. The Image Metadata can be used for...<br />Filtering images<br />
    20. 20. The Image Metadata can be used for...<br />Grouping images<br />
    21. 21. The Image Metadata can be used for...<br /><ul><li>Searching images</li></li></ul><li>The Image Metadata can be used for...<br /><ul><li>Searching Results</li></li></ul><li>Exposing external data using Business Connectivity Services (BCS)<br />Improved Business Data Catalog (BDC) in MOSS 2007<br />BCS Architecture<br />Rely on External Content Types & External Lists<br />Options to create BCS solution: SharePoint Designer 2010 & Visual Studio 2010<br />Image Source: http://msdn.microsoft.com/en-us/magazine/ee819133.aspx<br />
    22. 22. SharePoint Designer 2010 BCS Solution to Access Trident Registry<br />Add a new External Content Type <br />
    23. 23. Connection to Trident SQL Server<br />
    24. 24. Create Operations on “Activity” table<br />
    25. 25. Create Filter Parameters<br />
    26. 26. Create External List<br />
    27. 27. Retrieve Trident Registry Information<br />Trident Workflow Information<br />
    28. 28. Visual Studio 2010 BCS Solution to Access Remote Image Metadata<br />User Case:<br />Unix file storing system in ROB<br />Large volume of files<br />Raw data containing no or less meaningful metadata<br />Using a specific folder structure to indicate the image metadata e.g. Technology, Image Acquisition Machine, Group Head, Users.<br />Allow SSH to the file server<br />
    29. 29. Folder Structure Example<br />tomography<br />Systems<br />Inveon<br />MRI47<br />Data<br />Data<br />RM1<br />RM1<br />SF1<br />SF1<br />RM1_SF1_SF36_420<br />RM1_SF1_SF36_420<br />20100223_static_VCAM_tumour_M1_5hpi<br />20100223180102_01<br />
    30. 30. Image Metadata Retrieved:<br />Technology: Tomography<br />Image Acquisition Machines: Inveon; MRI47<br />Group Head: RM1<br />User: SF1<br />Study NameNumber: RM1_SF1_SF36_420<br />DataSet Name: 20100223_static_VCAM_tumour_M1_5hpi; 20100223180102_01<br />
    31. 31. Solution<br />Shell script to populate the image metadata XML<br />Use SSH to transfer the image metadata XML to the SharePoint Server<br />Apply Business Data Connectivity Services to connect SharePoint to the external image metadata XML<br />Navigating and searching the image metadata within SharePoint <br />
    32. 32. Business Data Connectivity Model template<br />
    33. 33. Edit TypeDescriptor Xml<br />
    34. 34. Implement ReadItem & ReadList Methods in the service class<br />
    35. 35. New External Content Type Created in BDC Service<br />
    36. 36. Create External List<br />
    37. 37. ROB Image List in SharePoint<br />
    38. 38. Aims<br />A reusable site definition for SharePoint to manage cancer related DICOM files.<br />Make visible the metadata from inside the DICOM files within SharePoint. Especially within Search.<br />Enable areas of the DICOM files to be marked for subsequent analysis.<br />To link with Trident for subsequent analysis<br />
    39. 39. Visual Studio 2010<br />The definition is built using Visual Studio<br />XML, C#, SharePoint APIs, Silverlight APIs <br />
    40. 40. Creating a new site from a site definition<br />
    41. 41. Site provisioning<br />SharePoint ‘provisions’ a new site from a site definition. <br />This requires the site definition to have to perform various actions – in the right order: <br />Global onet.xmlThis file defines list templates for hidden lists, list base types, a default definition configuration, and modules that apply globally to the deployment.<br />SPSite scoped features defined in site definitions onet.xml, in the order they are defined in the file.The onet.xml file defined in the site definition can define navigational areas, list templates, document templates, configurations, modules, components, and server e-mail footers used in the site definition to which it corresponds. <br />SPSite scoped stapled features, in quasi random order <br />SPWeb scoped features defined in onet.xml, in the order they are defined in the file. <br />SPWeb scoped stapled features, in quasi random order <br />List instances defined in onet.xml <br />Modules defined in onet.xml <br />[Source: Site Configurator v2: User Guide for Developers]<br />This is frustratingly easy to get wrong!<br />
    42. 42. Site Configurator<br />To help build the definition we used the SharePoint Site Configurator Feature<br />http://spsiteconfigurator.codeplex.com/ (January 2011) <br />This enabled simpler ‘provisioning’<br />
    43. 43. Useful techniques: mapping folders<br />
    44. 44. Issues with document library names<br />Site Configurator does not deal correctly with spaces in document library names for provisioning. Best to avoid spaces.<br />Thicket folders: folders ending in ‘_Files’ and a host of other similar names are hidden/renamed by SharePoint. See KB905231.<br />This ‘feature’ directly interacts with the DeepZoom technology, which uses ‘_files’ as a suffix for a directory. <br />
    45. 45. Including external unmanaged code<br />Technically tricky: avoid if at all possible<br />Map C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14BIN and place unmanaged DLLs in it.<br />Use managed code to call the unmanaged code. E.g. [DllImport("DICOM.dll")]<br />
    46. 46. DICOM types<br />DICOM has approximately 3500 field types – identified by their Tag name which has the form (Group, Element).<br />We adapted the IETF RFC4122 name-based GUID algorithm (section 4.3 of http://www.ietf.org/rfc/rfc4122.txt) to map these onto SharePoint Field definitions with name based GUIDs, and generated corresponding fields within the site definition. <br />An example generated field is:<br />There can be issues when re-loading fields into SharePoint. It worked first time isn’t good enough! We found that the above form worked the second time as well. The key extra attribute is ‘DisplaceOnUpgrade’.<br />
    47. 47. Things we would do differently<br />Use the Silverlight client object model<br />Prefer ‘Plain Old Document Libraries’ over Document Sets until they are more mature <br />Separate the DICOM field definitions from the site definition during development (they take an age to load on a development VM)<br />Consider recoding some of the ‘Untrusted code’ as trusted code.<br />