Monday, January 24, 2011

Using Dropbox in Windows to Automatically Sync Fixed Folders

Or, How to Seamlessly Backup All your Save Game Files

I thought I'd pass this on in the midst of everything else I'm doing as it hit me in an epiphany earlier this week.  In this demonstration I'm going to use my 'My Games' folder inside My Documents area for an example but this will work with any Directory you want to sync anywhere on your hard drive.

This is done using Vista/7's support for 'symbolic links', a feature that has been available for eons in the unix world.  This feature has some caveats in windows that are not present in the unix world however.  You can only create symbolic links to folders, not files.  Shortcuts to files work similarly, but I'm not sure they can be invoked seamlessly like a symbolic link (thou the help does claim it can make file symbolic links so there is something to it).  Also, you can not create symbolic links to or from network shares, even if they are mapped as a network drive, so what I'm discussing here would not work for backing things up to a SharePoint or Samba share for instance.  I'm not sure you would want to anyway, if you did, then this data would be unavailable when you are not on the correct network (or a network at all for that matter).

From here I'm going to assume you have DropBox installed already, and you've got a folder you want to exist everywhere, so lets get rolling.  First copy the folder you want to keep everywhere to a sensible location inside your DropBox area.  In my case I'm backing up my gaming information in the 'My Documents/My Games' folder for demonstration purposes.  In my DropBox area I added a 'Gaming' folder to my DropBox and copied the 'My Games' folder in it's entirety copied over to this location.  After this move the non DropBox folder aside (do not delete it until you've confirmed your in good shape, if at all).  I would also write out the 'Target' folder path and the full path for this location in your DropBox folder on a piece of paper for reference, you will need both full paths shortly.

After this you've got to bring up a standard old administrative empowered command line prompt (hit the windows key then type CMD and right click on 'cmd.exe' selecting 'Run as Administrator').  From here on you'll need to utilize the 'mklink' command provided in the path, this command is administrative privileged so please make sure you do start it up correctly to save some grief.  You can get a rundown of the function using 'mklink /?' as well as in the provided link.  After this you can run from anywhere the following (adjusted as appropriate for what you wish to make a link from and to):

mklink /D "c:/users//My Documents/My Games/" "c:/users//My Documents/My Dropbox/Gaming/My Games/"

Now if you go back to your My Documents folder you'll see a folder icon with a shortcut type sub icon on it.  This indicates your in good shape and it should work fine at this point.

Blue Pill:

This works surprisingly well with very little effort on your part individually.  Effectively it's doing exactly what you'd expect it to do without any massaging, which is awesome and pretty rare these days.  Now all you have to do is replicate this configuration on each computer with DropBox installed and your in good shape generally speaking.  I do notice a large number of files get updated when I play video games, and I'm not clear what the implications of this are for systems with drastically different capabilities (for say your games config files).  But all in all it works.

Red Pill:

As to the caveat above in the 'generally speaking' comment, I haven't tested this extensively for video games and the like.  I have read that there are some implications with rapidly updating files and DropBox on the forums (I seem to have lost the link).  However DropBox seems to be of the opinion that corruption is impossible based on their open service logs so to each their own.  Also remember that DropBox is NOT a backup service, it is a sync service (an extremely chatty one from a networking standpoint).  You should still make sure you've got a backup of anything you put on there in case of some sort of corruption caused by either your own hardware or the service.

Friday, January 7, 2011

Dicom Server Rundown

A few weeks ago (ok.. 'weeks may no longer be accurate..) I noted that I was starting a new project to get a Dicom server up and running, here I present the results of all my reading and poking and prodding.  The first thing to know is there is no silver bullet, none of these represented the ideal solution in my eyes and they are all clearly driven by their individual groups needs.  That said some turned out to be more practical than others in the long run.


CTN:

This is the package we've been running up till now.  It's biggest appeal is that exact legacy, we know it and it's idiocyncrosies.  Sorta kinda at least, we don't know it well enough to clean out the associated MySQL database for instance.  A bigger downside is that it hasn't been maintained since 2003, and this leads to some nuissances in getting it built on a Centos 5 install, but these problems are by no means deal breakers.  The bigger problem is the configuration which involves a combination of both compiler flags, MySQL tweaks and environmental variables that need to be configured just right for the house of cards to start up without throwing a fit.  It also requires our users to utilize some helper scripts that I'd like to excise if possible from our overall tool-chain.

DCF - Dicom Connectivity Framework:

A fairly powerful package if you have the time and inclination to do it yourself.  Manufacturing tools that deal with Dicom files and protocols in C#.NET, Java or C++.  However, this is an SDK.  There doesn't appear to be any official quick tools for setting up a default environment that you can just tweak.  It may be there but the advertisement page doesn't discuss it.  The 'Compass' package from the associated company seems more inline with what I was looking for but it's a pay for product and that breaks the goal of my project by being pay for.


Dicom.offis:

Sadly this software seems like it could fit the bill very well.  In their listing of 'Dicom Software' they even have a program called 'DCMSTCOM' which appears to be a storage application built off their free toolkit DCMTK.  It however is not free and as such is off the list of options for the purposes of this project.  That said, DCMTK could be used to build a new storage system for free (as it itself is free) but this isn't the pre built / tested land we are looking for here.  An extremely bare-bone server is included in DCMTK called 'storescp', however I'm not sure how one is supposed to know it exists since there's no way to get to the documentation without a google search (and prior knowledge).

Dcm4che:

All I can say is I found this package.  Beyond that.. I can't offer much, the documentation on what it does is effectively non existent, however there's an extensive page on how to install it.  There's some man pages and --help dumps you can get from individual tools but no overall documentation to show you how to use the package, which program does what or the really useful stuff like 'configs for typical use scenarios'.

XNAT:

This is an enormous 'do everything' package that's actually free.  Or at least it appears to be, I left the page a bit fuzzy on that part.  However it actually does too much (yes that's possible) as it's a storage system and an entire workflow / processing engine.  If we wanted to uproot the entire way we do everything from project creation, to patient registration and introduce the ability to audit and QA all these different points simultaneously this package could do that happily.  It'll even act as the 'send to' target for scanners through it's DicomServer package but it appears you have to buy into the whole XNAT system to utilize this piece.  You can't just use it as a storage system, you also have to use the project / subject management sections of the code as they are all interlinked.  This is again, great for a hospital and fairly unhelpful in our present research setting even if it is a very clean looking piece of software.


Conquest:

Conquest is a free solution that seems to be fairly tweak able, down to the way you want your file names stored.  Like many of the systems here the documentation is a bit slap dash but it gets you there with a little plugging.  On top of this there is a community that appears to have the active participation of the developers behind it so that's promising.  It can also be back ended by a number of different database systems and used as a dicom router for people looking to build larger more complex configurations than what we are doing, or simple no database required configurations (exactly what we want).  A nice touch is that none of this is done at compile time, make sure everything is there, build, and the edit the ini file to do what you want.  This is the big sell against the CTN system we are using at the moment, ease of configuration and reconfiguration.


PacsOne Server:

PacsOne is one of those packages you look at and on the surface appears to be perfect.  Until you read the fine print and realize that the 'basic' version is deliberately stripped of all the features you'd actually want and the Premium Edition has all the major features people would be looking for to not actually go mad setting up their servers.  It's also the only one that's completely up to date as the basic system doesn't work with MySQL past version 4.0.x and is only available for windows.  Needless to say this was abandon early on in the search for a possible solution.

ClearCanvas:

Like the PacsOne Basic server ClearCanvas is Windows only, which isn't very helpful when all your servers run CentOS.  However if we were running a windows server somewhere this is most likely the package we would run.  It's open source, has a clean front end, supports plugins, is available in both x86 and x64 flavors, a support community and has clear documentation on how to install.  However it requires MS SQL server and there doesn't seem to be a way around this, and that could be considered a major problem depending on what your trying to do (like how we would rather not run that..).

Blue Pill:

It should be considered generally unsurprising that there are a large number of payfor professional solutions to this problem, that tends to be the case with solving most problems.  What was surprising was how few workable solutions we found for making things work for free.  That said the CTN worked for us for many years quite faithfully, and it appears that Conquest will present us with a path forward as the underlying OS changes (since CTN is no longer seeing updates).  We have also found that bringing CTN forward requires relatively few tweaks and is more of a problem of making sure the correct packages are installed than anything else.  I will be posting my bosses notes on how we got this to compile once I've compiled them and confirmed them.  Conquest is also a capable system and we got it up in very little time, and are tweaking configs now to set it up to our liking.  I'll post this as well after we've completed the configuration and testing.

Red Pill:

While I've found a solution that seems to do exactly what I want it to do the overall field of choice seems to suffer from the fact that this is a rather niche service requirement.  The professional systems seem nice a sleek but feel like they suffer from being the root of an up-sell to the companies other products.  On the other hand the free stuff tends to be tool chests commercial software was built upon or a pile of code drawn together by one or two individuals to suit their specific needs.  This isn't necessarily bad but it makes the approaches very environment specific and the maintenance path somewhat shaky.  On the other hand, I have what I want and need and I can go about my work without writing too much code, so who am I to complain?