ITK
What are .txx files?
.txx files are where ITK puts the implementation parts of templated classes (actually class templates). These can't go in a standard .cxx (or .cpp) file, because the compiler needs to have the complete implementation of a template in any compilation unit (normally a cxx file) that uses a template. This is because a template is just a pattern for making a class, and can't actually get built by the compiler until it has a specific type to make an actual version of a template (an instantiation). For most developers, this means that template implementations just get put into header files (.h or .hpp). In fact, this is effectively what happens in ITK - the .txx file gets included by the .h file. This is what you should do in any case if you want to write a new templated class: just include the .txx file at the bottom of your .h file.
Of course the actual story is more complicated. For example, it is possible for the developer to predict in advance what types will probably be used with the template, and to make explicit instantiations of these in a .cxx file that gets compiled into an object. This can save a lot of compilation time. However, if you try to use a different type, and you don't have the complete implementation available to your compilation unit, you will get linker errors.
If you want to know more about templates in general, this is a good source: http://www.parashift.com/c++-faq-lite/templates.html
ITK has in fact a much more sophisticated mechanism that provides explicit instantiations where possible and includes the template implementation only where an explicit instantiation is unavailable. If you want, you can read about it here: http://cmake.org/Wiki/Proposals:Explicit_Instantiation . Fortunately, if you are just using ITK classes in your code, it works transparently. And if you want to create a new class that inherits from an ITK class, you don't have to understand or use this mechanism: as mentioned just include your .txx at the bottom of your .h file and you're good to go.
Actually there is one more complication that you may need to know about. The VXL component (math stuff mostly) of ITK uses an entirely different mechanism for template implementations. For details see http://public.kitware.com/vxl/doc/release/books/core/book_17.html (scroll down to "C.5 On the Use of Templates") . Basically, VXL provides only explicit instantiations, so if you want to use some odd-ball type as a template parameter, you'll need to make your own explicit instantiation. VXL (and hence ITK) provide a macro for doing this in a single line. Refer to the linked page for details.
What is the difference between Array and Vector, and Between Array2D and Matrix?
Basically, Array and Array2D do allocation for their data. Their sizes are fixed when they are constructed and cannot be changed thereafter.
Vector and Matrix in contrast contain their data, so if they are constructed on the stack, their data is also on the stack and no malloc or equivalent is called. Their sizes are set at compilation time.
What this means basically is that Vector and Matrix are very fast and cheap to make copies of, and use a little less memory. These advantages are only significant when Vector and Matrix are smallish. Feel free to pass around Vector and Matrix objects by value. Array and Array2D objects should be passed around by reference.
Array derives from vnl_vector. Array2D derives from vnl_matrix. Matrix has a vnl_matrix_fixed as a member. Vector on the other hand does not derive from, nor contain, any vnl object (although a vnl_vector_fixed object does exist). However, it has methods to provide copies of itself as a vnl_vector_fixed; copies of itself and vnl_vector_fixed are cheap.