User defined phantom

202 views
Skip to first unread message

mohammadrez...@gmail.com

unread,
May 4, 2020, 9:32:15 AM5/4/20
to JEMRIS
Hello every one
I am new with JEMRIS and I want to know how to define my own phantom into the software
Bests

Sarah Needleman

unread,
May 22, 2020, 7:49:22 AM5/22/20
to JEMRIS

Hi,

 

To define my own phantom, I am first creating arrays in Matlab for the whole phantom in terms of M0, T1, T2, T2S (T2*) and DB, and also (1,3) arrays containing the resolution and offset of each dimension. These arrays are all combined in a single structure which I save as a .mat file.

 

I’m then providing this .mat file as an input to the writeSample.m function (from either the JEMRIS download or the k-t BLAST example) to create an .h5 file in a suitable format and structure for the simulations.

 

Recently I’ve needed to create very large arrays which I’ve found easier to do in Python. The .h5 files can be directly created using the h5py library. The .h5 files appear to contain relaxation rates (1/T1 etc) instead of relaxation times (writeSample.m converts relaxation times to rates when writing .h5 files).

 

This is what I’m doing to define my own phantoms at the moment, hope it helps!

 

Best wishes,

Sarah

Tony Stoecker

unread,
May 22, 2020, 9:57:29 AM5/22/20
to JEMRIS
Thanks Sarah, would you be willing to share a python example?

BTW, since you say that you create "very large arrays": have you encountered performance issues with h5py? In another project we recently recognized that the pytables library seems to be (much) faster for writing large hdf5 files.

Best,
Tony

Sarah Needleman

unread,
May 22, 2020, 11:36:18 AM5/22/20
to JEMRIS

Hi both,

 

I’ve attached the script I use to create the samples in 2D. The created h5 sample can be used in the simu.xml file if using the command line, but for the MATLAB GUI a .mat file is required.

 

‘Large’ arrays (for me, at least!) produce ‘out of memory’ errors in MATLAB and am not able to simulate in parallel using JEMRIS on my desktop. I’ve just started using a cluster and haven’t experienced any issues yet. But I will be scaling up the arrays soon, so thanks for the pytables tip!

 

Best wishes,

Sarah

sample_creator_h5.py
Message has been deleted

Amanda Nicotina

unread,
Feb 27, 2023, 5:03:46 AM2/27/23
to JEMRIS
Hello everyone,

I'm also new to JEMRIS, and I have been trying to construct my own phantom but having difficulty creating .mat arrays.

M0, T1, T2, T2* and DB have to be data cubes. How do I know the correct way to represent the phantom with these arrays? Are they a physical representation of it?

For example, would a square 2D sample, let's say Nx = Ny = 4 for simplicity,  be:
M0(:, :, 1) = [0 0 0 0; 0 1 1 0; 0 1 1 0; 0 0 0 0 ]*M0, with the third dimension = 1 since it's a 2D phantom?

I'm still working with the GUI in order to get more familiarized with the program before moving to the command line.

Thank you in advance!

Best,
Amanda
Reply all
Reply to author
Forward
0 new messages