Issue61visualisefluorodose

Merged
#45 · Created  · Last updated

Merged pull request

Merging ref #61 (pull request #45) into develop

2cd49e8·Author: ·Closed by: ·2016-05-06

Description

  • Added OpenSkin code to the project. Added skeleton code (taken from my website) to display a skin dose map on the rfdetail page. No attempt to get it working at the moment. References issue #61

  • Added calculation of skin dose map data to the rf detailed view. The data is returned to the template as a new variable called skinmap. References issue #61

  • 2D skin maps are now displayed on the rf detail page. References issue #61

  • Updated code to check that certain fields have a value before trying to calculate the dose from a view. Do I need to check all of these? Should they be set to None or 0 if a value isn't found? The python and JavaScript code is hard-written for a 70 x 90 skin dose map at the moment: needs to be made more general. References issue #61

  • Display skin dose map using the correct orientation. References issue #61

  • Added a view to views.py and a url to urls.py in preparation for making the skin dose map calculations via AJAX. References issue #61

  • Added max and min displayed dose values to the skin dose map. These are in addition to the existing window and level controls. Changing any of them updates the display of the skin dose map, and also updates the other sliders as appropriate. The live version will only display one set of sliders: either the max / min dose, or the window / level ones. References issue #61

  • Updated JavaScript code to prevent min dose slider from having a larger value than the max dose slider. Also updated to prevent the max dose slider from having a value less than the min dose slider. References issue #61

  • Skin map controls are now either min/max or window width/level, and can be swapped from one to the other using a button. Also formatted buttons to match the rest of the site. References issue #61

  • Removed display of min dose in whole map. Put the sliders into a table to force an improved layout. References issue #61

  • Tinkered with some of the max/min wl/ww JavaScript. References issue #61

  • Skin map calculations now handled via AJAX. References issue #61

  • Included skin map width and height in json return. Changed hard-written dimensions in JavaScript code to use mag, skin map width and height instead. Will add control to change mag at some point. References issue #61

  • Skin dose map data is now stored as a pickle in a skin_maps sub-folder of MEDIA_ROOT. Before the calculation of a skin map this folder is checked to see if there is a pickle file in the folder corresponding to the current study. If there is, the data in the pickle is loaded rather than recalculating the skin dose map. I've used cPickle rather than pickle, as apparently it is much faster (http://wiki.python.org/moin/UsingPickle). I've also added a line of JavaScript to resize the dose scale to the height of the displayed skin dose map. References issue #61

  • Added phantom dimensions to the pickle. Fixed the pickle filename so that it ends in .p rather than just p. References issue #61

  • Started to add code to let the user choose a new colour scale for the skin dose maps. Not working yet. References issue #61

  • Updated so that user can now easily change the colour scale used for the skin dose map. Defaults to a greyscale. References issue #61

  • Now calculating min and max dose of skin map from as this is a much smaller array than . Calculating from the magnified array was causing memory problems. References issue #61

  • Adjusted number of characters to display min/max and wl/ww values. References issue #61

  • Now using slider max and min values when resetting the controls. Calculating from the magnified array was causing memory problems. References issue #61

  • Now using slider max and min values when resetting the controls. Forgot to convert to float. References issue #61

  • Put a border around the skin dose map that matches the border around the tabulated data. Increased the width of the dose scale. References issue #61

  • Removed use of skinMap variable. Reduces memory requirement, and wasn't necessary. References issue #61

  • Added the width of the flat part of the phantom and the distance around the curved edge to the 3D phantom properties. These will be useful when splitting the totalDose array into front, back, left and right parts for 3D display. References issue #61

  • Added a lovely tooltip to the skin dose map. Uses http://qtip1.com. References issue #61

  • Removed display of dose at mouse cursor now that there is a tooltip displayed. References issue #61

  • Changed style of tooltip. References issue #61

  • Begn putting together a skin dose map JavaScript object. References issue #61

  • Skin dose maps now make use of new JavaScript objects: one for the skin dose map, and the other for the colour scale. These make the code cleaner, with newer global variables. Also updated the style of the colour scale selection div. References issue #61

  • Corrected a couple of errors in the JavaScript code; reduced the number of decimal places used for total skin dose; changed Scanner to Equipment on the rfdetail.html page. References issue #61

  • Improved efficiency of JavaScript: redraws of the skin map and colour scale now only take place once for each update. References issue #61.

  • Added a 3D view of a skin dose map as a proof-of-concept (using four fixed png files, not the specific skin dose map being viewed). References issue #61

  • Updated 3D bit - corrected aspect ratio. References issue #61.

  • Trying to update 3d skin map textures with dose values. Not working at the moment. References issue #61

  • Trying to update 3d skin map textures with dose values. Not working at the moment, but an improvement. References issue #61

  • 3D skin dose map now works, but probably not being wrapped in quite the right place. References issue #61

  • 3D skin dose map now linked to changes in min/max dose and wl/ww; also linked to changes in colour scale. References issue #61

  • Put 3d skin dose map into an object. References issue #61

  • Added linear filter to remove browser warning. References issue #61

  • Plumbed all of the necessary 3d phantom dimensions in to the 3d skin dose map routines. References issue #61.

  • Reduced the number of properties of the 3d skin dose map object that are exposed using this.. References issue #61.

  • Reduced the choice of colour scales; checked the default one to begin with. References issue #61.

  • Removed reverse colour scale property (was considering allowing the user to reverse their selected colour scale, but have decided against it). References issue #61.

  • Used numpy roll to adjust the 3d skin dose map data for the split front portion. 3d map should now be correctly orientated. References issue #61

  • Changed method to draw skin dose map. Quicker now. References issue #61

  • Updated colour scale code to make it faster. Fixed a couple of bugs that were preenting things from updating. References issue #61

  • Added stylised person to orientate the user when viewing the 3d skin dose map. I'd prefer that it was displayed in the bottom-left corner, rather than the top-left, but can't work out the css for that at the moment. References issue #61

  • Orientation person now in bottom-left corner. References issue #61

  • Changed the material used for the ends of the 3d phantom and added a light source to illumunate them. Adjusted the brightness of the light source for the person. References issue #61

  • Made the 3d skin dose map interact with the light source. References issue #61

  • Preventing page from scrolling when mouse wheel is used over the 3d skin dose map. Makes zooming in and out of the map easier. References issue #61

  • Only show the 3d skin dose map if the user's browser supports WebGL. References issue #61.

  • Convert patient height and mass to float. If there is a value error (there isn't a value in the database) then set the values to defaults. This should sort out the error that Ed was having where the calculations failed if there was height and mass in the database: these were returned as Decimal, but OpenSkin requires float values.

  • Tidying up the skin dose map controls. References issue #61

  • Added option to save the skin dose maps as a graphic file. References issue #61

  • Adjusted positioning of skin dose map items; changed display of buttons and controls. References issue #61

  • Added styles to the range sliders; replaced hard-written dimensions with whatever the current skin dose map has; Update the size of the skinDoseMapGroup div according to the size of the current skin dose map. I've just noticed that the range sliders don't appear in Internet Explorer or Edge (whether they're styled or not) - need to find out why. References issue #61

  • Range sliders now show up on IE and Edge. References issue #61

  • Corrected typo and removed style. References issue #61

  • Restyled range slider for IE and Edge: much better now - more comparable to Chrome and Firefox. References issue #61

  • Added overlay to the 2d skin dose map that will orientate the user. The display of this overlap can be toggled on and off by the user. The overlay contains a little text at the moment, but also needs to have some lines drawn on to illustrate the boundaries between anterior, left, posterior, right and anterior. References issue #61

  • Deleted commented out code that is now in its own file. References issue #61

  • Added some dashed lines and additional labels to the overlay. References issue #61

  • Fixed TypeError when looking up patient weight or height data from the database when trying to calculate skin dose map. References issue #61

  • Updated text and lines on the skin dose map overlay. References issue #61

  • Replaced some hard-written phantom sizes with general variable values. References issue #61

  • Removed need for a second (rotated) copy of the skin dose map array for the 3d object. This halves the storage requirement (the pickle files are half thier size if there's only one skin dose map array). I've also shifted the skin dose map by half the flat front width, so that it now displays from left to right as front, left, back, right. This enables the overlay to be simplified. Anyone testing this themselves will need to delete their existing pickle files from their MEDIA_ROOT folder as the new code creates a different data file. References issue #61.

  • Removed right-hand line that is no longer needed. References issue #61

  • Enabled the user to manually set any max and min dose levels: they can be typed into the boxes that show the current max and min dose values. References issue #61.

  • Overlay is now saved if it is being displayed when the user clicks on the save button. Hopefully Ed will like this. I'll take a look at including the orientation man on the 3d map at some point. It also references issue #61

  • 3d skin dose map and orientation person now drawn on the same canvas. This means that the orientation man is included in the png when saved. It also means that there is only one 3d render, which is apparently a good thing. References issue #61

  • Removed unneeded canvas name when creating orientation person. References issue #61

  • Prevent an error if the skin dose map was unsuccessful. This was failing for a bi-plane Toshiba study where there was no value available for d_ref. References issue #61

  • I've started to implement a full screen display of the skin dose maps. References issue #61

  • Skin dose maps can now be made full-screen. I'm not sure that this is necessary, but I like it nonetheless. References issue #61

  • Added check to see if the browser supports the canvas element. IE 8 does not... References issue #61

  • 2d skin dose map image save should now work in IE and Edge, but untested at the moment. References issue #61

  • Skin dose maps can now be saved in Internet Explorer (tested with v11) and Edge browsers. References issue #61 and fixes issue #375

  • If the user's browser does not support the <canvas> HTML element then show a message. References issue #61

  • Added new <div> to display peak skin dose, phantom dimensions and patient height and mass. Not in it's final position yet. Added more information to the saved pickle, so any existing pickle files will need to be deleted. References issue #61

  • Adjusted appearence of peak dose, phantom size and patient height and mass data. Now automatically adjusting the number of decimal places used to display skin dose values. Switched the skin dose values to the right of the colour scale to avoid lots of white space between the values and the colour scale when only a few decimal places are shown. References issue #61

  • Added assumed before patient height and mass information on skin dose map. References issue #61

  • Updated skin dose map code to better use jQuery. Also simplified some sections. References issue #61

  • Patient height (patient_size) is stored in the database in m, so need to multiply this value by 100 before passing it on to OpenSkin, as this needs the height in cm. References issue #61 and hopefully fixes the issue that Ed was having with the skin dose maps displaying.

  • Updated OpenSkin code with the lastest from the main OpenSkin repository and removed the djp_testing file. References issue #61

  • Fixed problem where skin dose map group canvas wasn't resizing for different sized skin dose maps. Also added code to reset the rotation and zoom of the 3d skin dose map when the reset button is clicked. References issue #61

  • Added a bit of info about openSkin, and a simple disclaimer. References issue #61.

  • Added code to ensure that the confirm delete page works for bi-plane data. Fixes issue #377

  • Made skin dose map inforamtion text turn white when viewing 3d map so that it remains legible. Made a few tweats to other html to make it more correct. References issue #61

  • Adding Source to Detector distance to detail view of fluoro

  • Introduced a skin_map_version to version.py. This is used to check that skin dose map pickle files are compatable with the current version of the skin dose mapping code. I've set the version to 0.7 to begin with. References issue #61

  • Changed exception type on try command to the correct one. References issue #61

  • Added check that decimal places is finite. This may become infinite if there are problems calculating the skin dose map. References issue #61

  • Added checks for zero patient height or weight when calculating skin dose maps. References issue #61

  • Added code to only include Cu filters in openSkin's consideration of the backscatter. References issue #61

  • Switched on anti-aliasing for 3d skin dose map. Moved skin dose map AJAX progress animation to sit within the skin dose map group. References issue #61

  • Fixed an error where skin dose map calculation failed if a filter existed without a material. I have also hidden the skin dose map group and controls until the map is available to view. References issue #61

  • Put back d_ref and frames values to None - didn't mean to change them in the last commit. References issue #61

  • Changed the dispaly of total dose at RP from a forced number of decimal places to a forced number of significant figures. Fixes issue #381.

  • Non-working attempt to get celery to create the skin maps on import. The object being sent to Celery in rdsr.py needs to be JSON serializable.

  • This is probably a better way around, but it doesn't do anything! Refs #61

  • This is what I was missing, but it needs some imports Refs #61

  • Still not working, but I need to put out the rubbish and go to bed... Refs #61

  • Removed logger messages now I know it works. Refs #61

  • Created new tools file that comtains the make_skin_map routine. This single routine is now the only one used to calculate skin dose maps. I've checked that it works when being used to calculate data that's already in the database, but am unable to check that it works for skin dose map calculations that are made when a new study is imported into the system from an RDSR. References issue #61.

  • Fixed import, now confirmed new code for generating skin maps on import works. Refs #61

  • Created global setting to enable or disable skin dose maps. Also added global setting to enable or disable calculation of skin dose map data on import. Not done yet: there's no way to change these settings yet (need to add a new admin menu item); the setting values aren't populated to start with (I had to manually add the values to the database table). References issue #61

  • Created new config menu item that enables an admin user to update the skin dose map settings. It's a bit clunky at the moment. References issue #61

  • Updated the skin dose map settings page. Added a link to a help document that doesn't exist yet... References issue #61 and issue #384.

  • (Very) skeleton document for skin dose maps. References issue #61

  • Made submission of skin dose settings form stay on the same page on submit. References issue #61 and issue #382

  • Updated skin dose settings view so that the single database row is created if it doesn't exist. References issue #61 and references issue #382

  • Updated skin dose settings view so that the single database row is created if it doesn't exist. References issue #382

  • Added openSkin data export back to the rfdetail page if skin dose map display is switched off. Also included the text about only Cu filters being included. Added some text to let the user know that this version of OpenREM can calculate and display skin dose maps for some systems. References issue #61, issue #382 and issue #384.

  • Removed duplicate line that was included after the sync with develop. References issue #384

  • First draft of skin dose map documentation. References issue #61

  • Added link to skin dose map documentation to rfdetailedbase. References issue #61

  • Refining skin dose map documentation. References issue #61

  • Documentation updates: fixed error in openskin bitbucket link; made a couple of other small changes. References issue #61

  • Documentation updates: clarification of what the 2D image is showing. References issue #61

  • Adjusted the way that the colour scale increments and values are put on the colour scale to fix a display glitch. Also reduced the number of decimal places shown. References issue #61

  • Updated skin dose docs: added figures. References issue #61

  • Changed skin dose map tooltip to show dose to 2 significant figures. References issue #61

  • Updated skin dose map docs. References issue #61

  • Replaced a tab with 4 spaces. References issue #61

  • Updated skin dose map doc. References issue #61

  • Updated skin dose map doc. References issue #61

  • Replaced a tab with 4 spaces. References issue #61

  • Updated skin dose map doc. References issue #61

  • Updated skin dose map doc (spelling mistake in the first word!) References issue #61

  • Updated skin dose map docs. References issue #61

  • Updated skin dose map docs. References issue #61

0 attachments

0 comments

Loading commits...