Can we modify the code of blender and use it as a analysis software?
What do you mean "Can we"?

"Can we"  as in are we able to legally do it, or "Can we"  as in is it technically feasible?

Either way the answer is probably yes to both.

Blender is Open Source software so you are mostly free to modify it as you see fit, as long as you publish it under a compatible Open Source license if you make it publicly available. 

Quoting the license:


  Blender is released under the GNU General Public License (GPL, or
  “free software”).
  
  This license grants people a number of freedoms:
  
  
  You are free to use Blender, for any purpose
  You are free to distribute Blender
  You can study how Blender works and change it
  You can distribute changed versions of Blender
  
  
  The GPL strictly aims at protecting these freedoms, requiring everyone
  to share their modifications when they also share the software in
  public. That aspect is commonly referred to as Copyleft.


Technically speaking, I have no clue but Blender codebase is very adaptable, you could probably do it too if you are willing to roll up your sleeves and put some elbow grease in.

Whether it will be easy or hard is another matter, the source code may require substancial changes to support that kind of features, to the point of no longer being worth it to build on top of Blender.

That being said Blender as proved to be very flexible and versatile, and it has been adapted for many different workflows and industries, so it could probably be adapted for that too.