Import euler angle from one dream3D file to another

24 views
Skip to first unread message

hshe...@gmail.com

unread,
Jun 28, 2022, 11:47:46 AM6/28/22
to dream3d-users
Hello: 

I have some questions here. My case is I have a 3D dataset that has been segmented and generate a dream3D file, lets call D3D1. I exported the Feature ID map from D3D1 and did some processing in MATLAB. Now I have a bunch of tiff images and I segmented them use another dream3D and have another d3d file, D3D2, in which the dimension of the data container has changed D3D2 only have feature ID information but the id is different from D3D1.  I can make one to one mapping of the 2 Id list. What I want to do is assign the original Euler angles in D3D1  into D3D2, based on feature Id. Is there a filter can do this work? 

Thanks 
Hao 

hshe...@gmail.com

unread,
Jun 28, 2022, 11:55:45 AM6/28/22
to dream3d-users
Here are 2 files. The first is the feature file for every grain in D3D1. The second file is a link between d3d1 and d3d2 feature ids. 
1p5r_initial_feature_data google_forum.csv
link_original_d3d2_google_forum .xlsx

Michael Jackson

unread,
Jun 28, 2022, 2:32:52 PM6/28/22
to hshe...@gmail.com, dream3d-users
I would use MatLab (since you are familiar with it) to now generate a new output file has as many entries in it as there tuples, i.e., cells in the D3D2 file. For example if D3D1 file has a volume dimension of 100 x 100 x 100 that is 1,000,000 cells but the D3D2 file has a dimension of 90 x 90 x 90 then the this new file will have 729,000 lines in the file. Now you need to fill it with the Euler Angles from the first file by using the mapping table that you provided.

Here is some generic algorithm to accomplish that. You will have to implement this all in MatLab.

For each voxel in D3D2:
Int32 d3d2FeatureId = getD3D2FeatureId(currentVoxelIndex);
In32 d3d1FeatureId = mapD3D2_to_D3D1_FeatureId();
EulerAngle euler = getEulerAngleFromD3D1File(d3d1FeatureId);
setEulerAngleToD3D2File(currentVoxelIndex);
end for each

--
Mike Jackson
--
You received this message because you are subscribed to the Google Groups "dream3d-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mailto:dream3d-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dream3d-users/9b4b186f-abfd-4682...@googlegroups.com?utm_medium=email&utm_source=footer.



hshe...@gmail.com

unread,
Jun 28, 2022, 3:12:59 PM6/28/22
to dream3d-users

Thank you very much for the answer. To clarify, the file you talk about is a txt file that flattens out the 3D matrix? How is dream3D convert 3D index (row col page ) into a 1D index? 

Thanks 
Hao 

Michael Jackson

unread,
Jun 28, 2022, 3:25:46 PM6/28/22
to hshe...@gmail.com, dream3d-users

Oops. I never finish my thought. After you create this new file, then you can use the “Import ASCII Attribute Array” to import the data into the Cell Attribute matrix of the D3D2 file.

 

Data is stored in DREAM3D in the order of (Slowest to Fastest), Page (Z), Row (Y), Col (X). The index is computed based on that but you just need to make sure that you are following that scan order when generating this new file. So if you have your D3D2 file and it is of Z=100, Y=200, X=300 dimensions then your loop looks like the following:

 

For (z = 0; z < zDim; z++)

For(y = 0; y < yDim; y++)

For(x = 0; x< xDim; x++)

 

Index = (yDim * xDim * z) + (xDim * y) + x

 

--

Mike Jackson

To unsubscribe from this group and stop receiving emails from it, send an email to dream3d-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dream3d-users/021f0569-c4db-4469-8bd7-dd31efba605bn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages