Archive for the 'Computing' Category

Radial Fields

Posted in Computing 4 years, 7 months ago

For some work I was supposed to do later this term, I wanted a few synthetic vector/tensor fields. Something more complicated than a regular planar field.

I’ve used radial and tangential fields in electromagnetics (think solenoids and inductors) countless times, so it should be trivial to generate one, shouldn’t it? Unfortunately, I was getting mixed up in the minus signs somewhere and for the life of me couldn’t find out where. I checked and rechecked my math. I checked the usage of atan2(3) instead of atan(3). Finally, I had to resort to generating them by rotating the Cartesian basis and regenerating the tensors from the spectral components. Hacky, cludgy and doesn’t follow the DRY principle but this is just a test case. Yay tangential field:

tensor.png

To check the robustness of my algorithms later on, I need to add some noise to the fields and see how well they perform. Plagued by partial volume effects, diffusion tensor data are inherently very noisy, so it’ll be good to include noise as part of the algorithm development process. Right now, modeling noise in tensors is a very complicated process because the tensors themselves are built through a linear regression from diffusion weighted images. The noise is definitely not gaussian. Gaussian noise is easy, and that’s what I’m doing now until I fully understand how noise is transformed through the regression.

Another matter of complication is that regularizing (or denoising/smoothing) these fields is an active area of research. Extensions to the standard anisotropic edge-preserving filters like Perona-Malik are non-trivial (at least to me.) One of the technicalities of diffusion tensors is that they are positive definite. The positive definiteness is a physical manifestation as diffusion can only be zero at absolute zero (a great story for sci-fi.) I picked one of the many extensions just to test my workflow and here are the results. Pretty good I’d say for all the complications.

tensor15.png tensor15s.png

Lastly, opensource visualization tools seem to trip over the simplest of tasks. MayaVi seems to be the only one that can update the VTK pipeline when the source data changes. In other programs I have to rebuild the pipeline each time. As you can imagine, this gets tiring really fast.

MayaVi tensor visualization

Documentation Love

Posted in Computing 4 years, 8 months ago

I must be on a roll here. For the last few days, I’ve been spitting out about 500 words of coherent, easy to understand text for my coop report. I’ve never enjoyed writing technical documents so much before.

Everytime I intend to write a report, I always start with the LaTeX template that I made. This time, I decided to push the limits of what LaTeX has to offer.

wk2pdf-index.png

I’ve included some pictures from my half-baked document. Includes pictures of Table of Contents, PDF indexes, Table of Notation, Glossary, and References. All of them cross-referenced and hyper-linked automatically. Click on the images for higher resolution. Resolution is not meant to be able to read the text, it’s still a bunch of FIXMEs.

Table of Contents Notation Glossary References

New x86 Extensions

Posted in Computing 4 years, 8 months ago

Wow, feels like just yesterday that Intel announced new SSE4 instructions. AMD today announced new SSE5 instructions. The new instructions include:

  • Fused multiply accumulate (FMACxx) instructions
  • Integer multiply accumulate (IMAC, IMADC) instructions
  • Permutation and conditional move instructions
  • Vector compare and test instructions
  • Precision control, rounding, and conversion instructions

The Fused-Multiply Accumulate instruction is the most interesting. Architectures like PowerPC and Itanium have had these instructions for a long time. The Itanium processors do the fmac in the same number of cycles as an addition or multiplication. Here’s a paper that describes some elementary functions that can be computed using fmac.

Download the instruction set manual from AMD.

(via insidehpc)