27/08/2010

Neuromantic V1.7.5 is available

As promised, here is a download link for the newest version of
Neuromantic (V1.7.5) produced for DIADEM. It's a bit.ly shortened
link that lets me keep track of the number of downloads and vaguely
where they're coming from, but it points directly to my DropBox
account.

http://bit.ly/buYykd

The contents of the zip should work in a self-contained fashion, and
should not require any files from any previous downloads.

Now, I'm pretty sure that I've included all the dependent DLLs in the
zip file, but I don't have a clean platform to test on so I can't be
sure. Let me know if it fails on start-up and I'll host the missing
files asap.

The main changes to the application are:
* Dynamic memory management. You should hopefully not get annoying
access violations when you load in a stack that's too big, as
Neuromantic will automatically load/unload images dynamically to keep
the memory footprint acceptable. There will probably still be memory
issues if you attempt to visualise large stacks in 3D, though, which
is something I may address in future now that I have a working build.
* Multi-stack GUI - this lets you use large-tiled projects and show/
hide different tiles as tiled, as well as manually entering offsets.
The "Load/Save Tiled Project" menu options will save all the stack
positional data to an .nproj file (the reconstruction itself will
still need to be save separately to SWC). If you lose the multi-stack
GUI, open it again through Window->Show Multistack GUI
* Custom labelling schemes - you can now change the colours associated
with each segment type, so no more endless yellow after segment type
6. See also Load/Save labelling scheme on the main menu.
* A few 3D GUI fixes - the aspect ratio now remains correct when
resizing the window, which had been bugging me for ages, and the lines
are properly anti-aliased.

For other minor changes see the _README.txt file.

Feel free to pass on the download link to anyone who might be
interested (once you're sure it's not missing any files!).

In general, I shall be posting links to new version on the NeuromanticUsersGroup, so please join that if you're interested.

Labels: , , ,

31/03/2008

Neuromantic V1.6.2 now available!

OK, I have uploaded Neuromantic V1.6.2 to the site - I've made sure the ZIP file works this time, also ;)

V1.6.2 mainly adds some bug fixes and minor features over V1.6.1, and I'm quietly confident that I've finally squashed the horribly annoying byzantine error that I've been trying to track down for several releases.

I've altered the selectable bounding boxes on compartments so that they're now the entire width of the compartment, rather than always 10 pixels either side. Lone nodes (with parent nor child) also display their radius now in the form of a circle around the midpoint, and it should be easier to select/drag around the root soma point of a tree that's surrounded by child compartments.

Another handy addition is the ability to press Ctrl+W and cycle through all the currently selected segments. This could be useful when correcting trifurcations or similar.

In terms of semi-automatic reconstruction, a median radius filter operation has been added that helps compensate for radius estimation errors. The radius of each compartment is simply calculated as the median of the estimated radii of a 3 compartment neighbourhood along the neurite.

It's also now possible to Autoselect overlapping points i.e. points that have exactly the same coordinates as another point in the tree. It was primarily added for Duncan Donohue, who's currently administrating the NeuroMorpho archive, and shouldn't be needed in the standard course of a reconstruction. In the case of overlapping identical subtrees, it will currently just select one of the subtrees arbitrarily (depending on ordering in the list). I believe that it should select entire overlapping subtrees due to the way the tree sorting algorithms work, but it's conceivable that in some circumstances it will select some from both - let me know if this happens.

Labels: , , ,

03/03/2008

Composite stack support

Neuromantic V1.6.0 will be released tomorrow - the main update here will be the support of composite stacks made of multiple image stacks. These composite stacks may be saved and loaded via project files (*.nproj).

For the first release, there will be several limitations:

* All stacks will be loaded at once and remain so, so no memory saving is made. This constraint will be quickly relaxed in future releases so that you can free/reload stacks as desired.

* Rotated composite stacks (if you've rotated in X/Y or Z) cannot be saved with a project file. This can be circumvented initially by saving the composite stack prior to rotation, and making sure that the stacks are rotated back to the original position before saving the reconstruction. This constraint will also be relaxed in future, although it will take longer as it relies on me finishing the improved stack viewing algorithms.

Labels: , , , , , ,

20/02/2008

Neuromantic V1.5.5 now released (and general update)

The new release is a little later than I originally intended (as always), but V1.5.5
fixes quite a few bugs and implements quite a bit more functionality.

* Fixed minor bugs associated with statistics calculations from tree -
the area and volume calculations were badly rounded due to storage as
an integer rather than a float (bad Nathan!)
* Implemented statistical testing properly - in V1.5.4 this didn't
really work at all. I blame the testing department. Wait a minute, I don't have one.
* Speeded up stack rotation and other bitmap operations significantly
through avoiding use of standard Windows TBitmaps.
* Fixed bug associated with stack rotation on certain sized stacks
* 3D stack visualisation now supports standard colourisations such as
JET and HSV, and has generally still been jazzed up. I still need to
cause the stack to be subsampled when it's too large, though, as this
can still bring the applications to its knees, so be careful.
* Implemented ability to drag multiple selected segments in both 2D
and 3D windows, as requested originally by Duncan and more recently by
Kerry. I'll try and implement similar functionality for radius
editing soon.

On a similar note, I'll try and make time to create some video tutorials with CamStudio, which is a very handy utility that allows you to make videos of your desktop and record audio over it. In this way it should be ten times easier to demonstrate the usage of Neuromantic than attempt to describe its use in the manual.

If you find any bugs, please report them to the Neuromantic User Group (which is linked to in the application from the About menu) and I shall attempt to squash them for the next release.

Labels: , , , ,

12/12/2007

Oopsie!

OK, I've found a fatal bug in Neuromantic - these don't come up very often, and it's only been in existence for the last couple of releases.

When working with a reconstruction that is planar (i.e. all segments have the same Z coordinate), changing the mode to "Colour By Depth" will, up to V1.5.3 (since whenever I added it, which is only V1.5.1 or later), cause a div by zero error in the 2D rendering algorithms and completely crash out the application. Yes, I hang my head in shame for not forseeing a potential div by zero error - you'll find me in the naughty corner.

I shall be posting a newer release that fixes this tomorrow, as I really can't allow such bugs in the program. As well as this important bugfix, it will also have significantly improved sectioning of volumetric data.

I've also been further working towards supporting multiple stacks simultaneously, and have now gotten the semi-auto tracing functioning with this. Therefore, in future releases (not until after Christmas, though) you'll be able to load and register multiple image stacks, then semi-automatically trace a branch between the stacks due to the cunning hierarchical patchwork strategy.

Labels: , ,

04/12/2007

Information on the next update

Right, I've now successfully implemented the ability to drag segments around in the 3D view - this should come in very handy for correcting Z errors and editing segment positions based on overlaid image data.

The other main thing I've been doing is trying to get 3D textures to work in OpenGL and find out whether they'd be a better choice for the rendering. So far, I'm really not too impressed - it just doesn't look as good as the normal textured version, and there's also much stricter limits on size (max side of 512 pixels, rather than 4096 for normal textures). Also, OpenGL demands only power of 2 sizes in both X,Y and Z for the 3D texture, leading to yet more memory wastage.

I'm still working on it, though, but at the moment I'm thinking of staying with the current set up (albeit with a bit of neatening up and added cunningness)

Labels: , , ,

30/11/2007

Neuromantic V1.5.2

Right, Neuromantic V1.5.2 is out, but only really fixes a couple of minor bugs related to 3D visualisation and stack rotation. The slice bar at the bottom right of the 3D window will allow you to define which section of the stack you see (in a simple way for the moment). If you can, I thoroughly recommend loading some MRA data or similar and trying that with some 3D glasses - it's pretty amazing.

The other minor thing it adds is a list of web links in the About menu, which mean that users can directly get to the Neuromantic user group and main page without having to remember the URLs.

The next version (out soon), will actually add some proper functionality - I'm currently finishing off the ability to drag the reconstruction segments around in the 3D window. This will have two major advantages:

1) You'll be able to more easily correct Z errors in this view from semi-automatic tracing.
2) When working with overlaid 3D data, you can drag the compartments in this view to achieve higher accuracy than may be possible with the 2D view.

At some point in the future it would be nice to be able to trace in this mode also (like Imaris FilamentTracer), but that's probably going to take quite a while. To some extent it probably depends on how bored I get over Christmas ;)

Labels: , ,

27/07/2007

Update on Multiple Stacks with Neuromantic

At CNS 2007, several people requested functionality for Neuromantic such that multiple image stacks could be loaded in simultaneously, some as a prerequisite before it could be useful to them.

Now, mainly because I find it hard to resist a challenge, I have been working on this very problem. It is not complete yet, but in my current test version it is now possible to load and display several stacks (although the semi-automatic tracing has not yet been updated to work with this). Also, it is not yet possible to register the stacks yet, but that's just a straightforward case of adding functionality to the GUI to alter the various stack parameters.

As well as each stack having its own global offsets in the space, each individual stack bitmap will be able to be perturbed in x,y a little to account for any jitter that may be present, in a similar way to the Reconstruct application.

Finally, I'll need to sort out some appropriate memory management so that the application will load/free bitmaps as required dependent on the memory available.

Labels: , , ,

16/07/2007

Back From Canada...

Yes, I am now officially back from Canada and the lovely CNS 2007 conference.

The workshop on neuronal reconstruction with Neuromantic went well, and I had more attendees than I initially expected. Although plenty of people there employed reconstruction methods (mainly the manual mode of NeuroLucida, from the discussions I had), the emphasis of the conference was very strongly on modelling rather than reconstruction.

Thanks to everyone I talked to, and I'll post a picture of the happy smiling faces from the workshop when I get chance :)

I'm trying to put together a mailing list at the moment of people who are interested in updates to Neuromantic, so please leave a comment to this post if you wish to be added (or email me). The mailing list will be mainly just to inform people of new releases of Neuromantic, thus saving the effort of having to keep checking the page. The blog comments are always moderated, so I won't display them and leave your email addresses open to being trawled by the innumerable bots on the net.

After discussion, the main functionality that people wanted to see in Neuromantic would be the ability to load in multiple stacks simultaneously and register them, thus allowing them to be loaded in separately throughout reconstruction in order to avoid the requirement for silly amounts of RAM. I shall get onto this asap, as it sounds like a useful ability to add (albeit quite a bit of work!)

Labels: , ,

06/07/2007

Interface updates

While trying to tidy up the automatic tracing, primarily by making it simpler and more intuitive to select the correct threshold/Gaussian smoothing, I've also done a bit of an overhaul of the mode system as it had been bugging me for some time.

Originally it made more sense to me to have clearly defined modes, as I didn't see how I could add all the required functionality in an intuitive way without this mechanism. However, after putting most of the functionality of Tree Edit mode into the AutoTrace mode for V1.4.0, it seemed to work quite well.

The first mode (stack manipulation) has become completely redundant as all its functionality was duplicated in every other mode, so it was just an unnecessary distraction. It is now bitten the dust.

The second main change is the merging of the Manual mode and Tree Edit mode - now you can select/edit the position/radius of segments as you add them, without having to change modes.

This leaves two main modes - manual and automatic, which just lets you switch between how you want to add segments to the reconstruction.

A reminder of functionality:
* Edit segment X/Y position - click and drag with left mouse button
* Edit segment radius - hold down CTRL, then click and drag with middle mouse button (I may simplify this in future)
* Edit segment Z position - select segment with left click, move visible slice to correct position and select (Edit->Set Z To Current Slice), or CTRL+C.

To suppress the editing functionality (selecting segments when you left click on them), hold down CTRL+ALT (this is the case for both Manual and Auto modes). This is necessary if you need to add a line that starts where another segment is.

This will all be released shortly as Neuromantic V1.4.1.

NOTE: I've become aware of a bug that can take down the entire application - it's an uncommon error relating to deleting multiple segments. I therefore suggest saving before doing this until I release 1.4.1., where I've surrounded the whole area with exception handling and, hopefully, squashed the underlying bug too.

Labels: , ,

02/07/2007

Neuromantic Goes to CNS 2007

I'm off to the International Computational Neuroscience Meeting 2007 this weekend, where I will be giving a short one day workshop on using Neuromantic to reconstruct neurons - the workshop description may be found here.

Title: Reconstructing neuronal morphology from serial image stacks

Organizer: Dr. Darren Myatt, Cybernetics, School of Systems Engineering, University of Reading, UK

Description:
To further understand the role that neuronal morphology plays in brain function, it is important to be able to generate appropriate models of dendritic morphology from a variety of microscopy techniques. Although several good free databases have come into existence over the last few years (mainly exploiting the SWC format), there is still a general paucity of reconstructed neurons available for statistical analysis and comparison.

This half-day workshop, which is open to all CNS attendees, will provide practical experience of reconstructing dendritic trees from image stacks using the freeware tool Neuromantic, and thus may be useful to anyone interested in creating or analysing reconstructions of neuronal morphology. If you wish to take part, please bring your own laptop that can run or adequately emulate Windows.


In an ideal world, I would have been able to run the workshop in a computer lab, thus removing the requirement for bringing your own laptop, but due to CNS taking place in a convention centre this was not possible. My current plan is to give an introductory presentation about reconstructing neurons in general, and then provide an example stack which people can reconstruct in order to get the hang of the application, as well as gaining further understanding into the problems and ambiguities faced when performing such reconstructions.

Of course, it'll also be a great time to get direct feedback about the application from the Computational Neuroscience community and suggestions for improvement.

Labels: , ,

29/06/2007

Neuromantic V1.4.0 - How to use it!

Yes, a new version of Neuromantic is *finally* available! Version 1.4.0 performs semi-automatic tracing of neurites by automatically tracing between user-defined beginning and end points. On a basic level, this new version should encompass almost all of the basic functionality of NeuronJ, but with the ability to trace in 3D and improved midline tracking on thicker dendrites.

Although the semi-automatic tracing (particularly the radius estimation) is not quite as well as I'd like yet, I wanted to release a version so that people could see what it will be able to do, especially as there are a number of tweaks that make semi-manual reconstruction easier, too.

I'm pretty happy with the actual tracing process, but I still need to significantly improve the radius estimation algorithm and post-processing, which are both a little rudimentary. It's probably quite useable in most situations, but it may require a bit of cleaning up afterwards where the radius estimation has gone wrong. It should still improve productivity in most cases, though. As such, the radius estimation is off by default, and all segments will be a uniform radius. To apply the radius estimation, select the entire branch (by pressing CTRL+left clicking it in Tree or AutoTrace mode) and press CTRL+R (or select Edit->Restimate Radius from the menu).

Some tips on cleaning up auto-tracings:

* A segment's position may be altered in Tree/AutoTrace mode by left dragging it.
* The radius of a segment may be altered in Neuromantic in the main (non-3D screen) by selecting the segment (either in Tree or Auto mode) and holding down the middle mouse button along the length of the segment and dragging.

Upon entering the application, you should notice that there is a shiny new toolbar button up at the top left that says "AUTO". Clicking this will get you into semi-automatic mode, so do it! The associated right hand panel has a number of twiddle factors for the algorithm (which I promise to clean up and automate for subsequent releases).

Firstly, notice that there's a couple of radio buttons on the panel for either following dark or light dendrites - make sure the correct one of these is selected for your data or odd things will happen. Also, remember that pressing "Invert" on the image processing panel doesn't invert the underlying stack data, so if you're looking at an inverted stack of a Golgi-stained neuron the "Dark dendrites" option should still be selected.

The basic process of semi-automatic tracing is as follows:

* Navigate to the correct slice by auto-focussing on the desired point (middle mouse button click achieves this, as in Tree mode).
* Click and hold the left mouse button: this will begin the tracing.
* Move the mouse roughly down the dendrite - you will see blue boxes pop up (currently of a default size of 128x128 pixels). This shows the area that is currently being image processed and routed. Each box represents (currently) a stack of 11 patches from the current slice - 5 to the current slice + 5.
* As you move the mouse down the dendrite auto-focus on the dendrite by clicking the middle mouse button (I admit this is a little fiddly at the moment, as you need to be pressing the left and middle mouse buttons at once). Also, you can still translate the stack by also holding the right mouse button.
* If a current route has currently been calculated to the position the mouse cursor is at, a line showing the basic trace will be shown. Once a tracing has begun, the application is constantly calculating routing information, so if no route currently exists then waiting for a few moments will help.
* Release the mouse button to complete the tracing.
* If the algorithm won't correctly trace a neurite in one go, segment it in multiple traces - the next trace will automatically connect up to the last as long as the start point is nearby.
* If the trace ends up horribly wrong, just press CTRL+Z to undo it and start again.

The following labelled image captured partway through making a trace should make it clearer:


There are two main twiddle factors to the tracing algorithm - the first is the Neurite Radius slider. This determines which radius of neurite will be detected most effectively (and traced most effectively). If tracing is not working at all, or not working well, this is most likely to be the problem. The slider varies from 1 pixel radius to 30 pixels radius at the moment, although I shall hopefully replace this in future with a more visually intuitive brush size selection tool, a bit like a graphics package.

The second slider is the Neurite Threshold, which determines which pixels will and will not be counted as neurites. The higher (more to the right) the slider is, the less pixels will be considered, and the faster the routing will occur. Turning on the "Show Routing Progress" option will show you which pixels are actually currently being considered, by colouring them in shades of blue (based on the cost function at that point), and thus let you tune this parameter correctly for your data. Hopefully, though, this will be done automatically in future versions. The following image shows what the routing progress looks like when the parameter is set to about the right level:



If the threshold is too high, you might see something like the next image: it is apparent that the algorithm is not considering pixels that should be counted as neurites, as there is not a solid line between the start and end point.


Conversely, if the threshold is too low you may just end up with all the patches filled with blue, in which case the algorithm will work significantly more slowly than it should, so you should put it up a little.

The Segment Length slider bar determines the subsampling rate of the final calculated path. This is by default set to 5 pixels long, but should in general be set high enough that you don't end up with a billion segments but low enough so that you still approximate the shape of the dendrite well.

3D Window


Post-processing is also performed on the Z axis to clean it up using the AutoFocus function (although this can be removed by unticking the Post Processing box on the AutoTrace panel). However, when neurites overlap close to each other you may still get an error where the focussing jumps to another neurite and then back again, creating an error which looks a little like this (the view has been rotated so that the horizontal axis represents the stack images):



In order to get rid of this artifact, select (by left clicking, although the standard CTRL and SHIFT controls for the main window also work in here too) the last correct segment BEFORE the artifact, up until the end of the artifact, like this:



The direction of the dendrite here is going from the top to the bottom of the screen.

Pressing CTRL+W (or Edit->Z Interpolation) will then interpolate the Z values between the beginning and end of the identified artifact.



Other features


Another thing which has been added is a couple of interpolation options for the main window. These can be selected between using the F keys:

F9 - No interpolation
F10 - Bilinear interpolation
F11 - Bicubic intrpolation

As with the rest of the image processing, the interpolation is performed on-the-fly as you zoom in to the image, so it does not add any extra memory burden (take that, ImageJ!). The interpolation can be handy for judging more accurately the midline/edges of neurites.

Also, if you've bothered to read this far, please leave a cheery comment on the blog post so that I know I didn't spend all this time writing it for nothing ;)

Labels: , , , ,

30/04/2007

Semi-automatic tracing beta almost complete

Right, a fully working version of the semi-automatic tracing with radius estimation is basically complete - I'm just in the process of doing a little debugging with the GUI and increasing the user-friendliness before I post it.

This (very significant) update will vastly increase the speed of reconstructions by avoiding the need to define each segment separately. In essence, all you do is roughly drag the mouse along each dendrite, and the actual tracing and radius estimation is done automatically.

Some quick screenshots of a subtree I quickly (less than a minute) segmented:

The blue squares show the areas of the stack that have been image processed, and the coloured line the current route: the patches are generated in real-time during tracing to avoid slow pre-processing and massive storage requirements.


The subtree rendered in 3D:


The subtree viewed with the Z/Y plane - the discretisation of the Z coordinates is apparent, but the Z values don't jump significantly and match well with hand-segmented reconstructions.


Coming soon!

Labels: , , ,

20/02/2007

Improving selection ability

Some further updates have just been added based on selecting and editing points.

* Individual segments that overlap in x/y can now be selected much more easily than before in the 2D window - it will now select the closest segment to the cursor, rather than the first one in the list that satisfies a closeness threshold. This should make editing trees significantly simpler.

* Existing segment points can now be dragged about in the 2D window. In Tree Mode, simply hold down the left mouse button and start dragging the point around. In order for the point to start moving the mouse must be dragged over 4 pixels first: this is so that segments are not accidentally dragged when selected.

I also intend to update the bottom scroll bar so that when a stack is not loaded in the scroll bar can be used to drag over the Z range of a loaded reconstruction.

These will be the main updates that will form Neuromantic V1.3.2, along with a few other minor bug fixes.

Labels: ,