Extract the unique locations from x-, y-, and z-dimensions in separate vectors for each text file
Engineering
Data Description: You will be provided text files containing data exported from a model scaled to 1/100 of the actual value. These text files have a header and data. The data is space-delimited and has 4 columns: x-, y-, and z-coordinates and a current density value. The x-, y-, and z-coordinates describe the location in 3-dimensional space from which the value belongs. Values are supplied for locations from the specified compartment (e.g. gray matter). Locations from an entire cube were exported, but not all locations contain a value. Locations not containing a value are included in the text file but the value is specified as NaN. You should place the data back into a 3D matrix before continuing to visualization. The visualization you create will overlay these multiple compartments and/or current density maps in a single 3D display. However, not all compartments used the same cube of locations to export. Be careful to ensure the visualization has the compartments properly overlaid (HINT: use meshgrid). Please color the gray matter as gray, the anode electrodes as brown, and the cathode electrodes as green. Create a colormap for the current density map with a red-yellow scale where red is low current density and yellow is high (maximum estimated current density). Apply a threshold to the current density map. This threshold should be adjusted to best show the current density distribution without highlighting the entire brain. Areas with current density less than the threshold should allow the underlying gray matter (in gray) to be visible. The threshold should be somewhere around 0.05 (after rescaling the data). You will be provided with files representing gray matter, electrodes encompassing the anode (positive terminal) and electrodes encompassing the cathode (negative terminal) structures. You will also be provided with a file representing current density estimates from the gray matter. 2 5- Plot all the data using the MATLAB function patch. The structural data should be displayed using a constant color while the current density data should be plotted using a red/yellow colormap. Adjust the lighting, material, etc. for the best visualization. Development process: You are tasked with developing code that will perform the following functions: 1- Load the data from the text files. You can read the number of nodes (values) in the text file from the header of each text file. The header in each file has the same number of lines and the same organization. 2- Extract the unique locations from x-, y-, and z-dimensions in separate vectors for each text file.. 4- Convert x, y, and z vectors from each text file into 3 dimensional arrays to be used with the MATLAB function isosurface. These matrices must be the same size as the data matrix created in
Leave a Reply
Want to join the discussion?Feel free to contribute!