From rafaelnh21 at gmail.com Tue Jan 2 10:58:12 2018 From: rafaelnh21 at gmail.com (Rafael Henriques) Date: Tue, 2 Jan 2018 15:58:12 +0000 Subject: [Neuroimaging] [Dipy] Re: Warnings when running free water model Message-ID: Message-ID: Hi Arnold, This is just warning you that in some voxel/voxel's the fwDTI's non-linear convergence procedure did not reach the global minimum with the default number of iteration defined in scipy.optimize.leastsq. For faster convergence try using fwDTI's Jacobian by calling the fwDTI model in the following way: fwdtimodel = fwdti.FreeWaterTensorModel(grab, fit_method="NLS", jac=True) This warning is typically generated by background voxels. I also recommend you to mask your data when fitting. Best, Rafael Henriques > Date: Thu, 28 Dec 2017 22:11:21 -0600 > From: Arnold Evia > To: neuroimaging at python.org > Subject: [Neuroimaging] [Dipy] Warnings when running free water model > Message-ID: > mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hello, > > I am applying the free water dti model to my data, and receive the > following warnings: > > /Users/arnoldevia/anaconda3/lib/python3.6/site-packages/ > scipy/optimize/minpack.py:427: > RuntimeWarning: Number of calls to function has reached maxfev = 1800. > warnings.warn(errors[info][0], RuntimeWarning) > > /Users/arnoldevia/personal_programs/dipy/dipy/reconst/fwdti.py:454: > RuntimeWarning: overflow encountered in exp > y = (1-f) * np.exp(np.dot(design_matrix, tensor[:7])) + \ > > The code I am using is essentially the same as the code used in the free > water model documentation. > What do these warnings mean, and what should I do to address them? > Please let me know if additional information is needed. > > Thanks in advance! > -Arnold Evia > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: attachments/20171228/1f0a283b/attachment-0001.html> > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > > > ------------------------------ > > End of Neuroimaging Digest, Vol 31, Issue 11 > ******************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pinghongyeh at gmail.com Wed Jan 3 14:43:01 2018 From: pinghongyeh at gmail.com (Ping-Hong Yeh) Date: Wed, 3 Jan 2018 14:43:01 -0500 Subject: [Neuroimaging] [Dipy] MAPMRI between subject comparisons Message-ID: Hi Dipy users, I am wondering if the MAP-MRI measures such as RTOP, RTAP, RTPP, NG etc are ready to use for between-subject comparisons. Are there any scaling factor that needs to be applied beforehand. I've noticed that MAP-MRI measures are very susceptible to artifacts. Thank you. Ping -------------- next part -------------- An HTML attachment was scrubbed... URL: From hesheng at nmr.mgh.harvard.edu Thu Jan 4 10:44:07 2018 From: hesheng at nmr.mgh.harvard.edu (Hesheng Liu) Date: Thu, 4 Jan 2018 10:44:07 -0500 Subject: [Neuroimaging] Multiple postdoc positions available at Martinos Center for Biomedical Imaging/MGH/Harvard Medical School In-Reply-To: References: Message-ID: <49CA2BF5-C4F4-45E3-B235-9D1D4CB03C8B@nmr.mgh.harvard.edu> Dear Colleagues, Could you please spread the following ads ? Thanks. Multiple postdoc positions are available at the Hesheng Liu Lab (http://nmr.mgh.harvard.edu/bid/Home.html), Martinos Center for Biomedical Imaging, Massachusetts General Hospital/Harvard Medical School. We are looking for 2 postdocs with a PhD degree in biomedical engineering, electrical engineering, computer science, or related discipline. We are looking for other 2 postdocs with a PhD or MD degree in radiology, neurology, psychiatry, psychology, or related discipline. The research will focus on studying functional network structure in the individual subject?s brain, and understanding the functional organization that differs in individuals with neurological and psychiatric illnesses (e.g. epilepsy, brain tumor, stroke, schizophrenia, depression, or OCD). The ideal candidate will have a background in brain research using MRI or MEG/EEG/ECoG/TMS, and demonstrate good writing skills. Interested applicants should email: (a) CV, (b) writing sample (e.g., a published manuscript), and (c) letters and/or contact information for three references to Dr. Hesheng Liu (Hesheng at nmr.mgh.harvard.edu). A two-year commitment is required. --- Hesheng Liu, Ph.D. Associate Professor, Harvard Medical School & Massachusetts General Hospital Director, Laboratory For the Study of the Brain Basis of Individual Differences http://nmr.mgh.harvard.edu/bid/Home.html The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lbrand at mymail.mines.edu Thu Jan 4 18:09:12 2018 From: lbrand at mymail.mines.edu (Lodewijk Brand) Date: Thu, 4 Jan 2018 15:09:12 -0800 Subject: [Neuroimaging] Plotting a Single ROI from an Atlas Message-ID: Hi All, I am trying to figure out a way to plot specific ROIs from an atlas in Python. I am looking specifically at the AAL atlas: aal_atlas = datasets.fetch_atlas_aal('SPM12') I would like to plot individual regions (eg. 'Rectus_R', 'Insula_L', 'Insula_R', etc.) that are specified within the atlas. I've been able to plot the entire brain image with all the ROIs at once cannot seem to figure out how to do each one individually. Any help/direction would be greatly appreciated! Best, Lou -------------- next part -------------- An HTML attachment was scrubbed... URL: From mauro.zucchelli88 at gmail.com Fri Jan 5 05:46:37 2018 From: mauro.zucchelli88 at gmail.com (Mauro Zucchelli) Date: Fri, 5 Jan 2018 11:46:37 +0100 Subject: [Neuroimaging] [Dipy] MAPMRI between subject comparisons In-Reply-To: References: Message-ID: Hi! Low SNR in multi-shell data with high b-values are a problem for all the higher order models, including MAP-MRI and many compartmental models. Moreover, MAPMRI presents numerous parameters tha you can adjust in order to maximize its performances. Can you give us more information on your dataset? E.g. SNR, number of samples, number of b-values, etc. Kind regards, Mauro On Wed, Jan 3, 2018 at 8:43 PM, Ping-Hong Yeh wrote: > Hi Dipy users, > > I am wondering if the MAP-MRI measures such as RTOP, RTAP, RTPP, NG etc > are ready to use for between-subject comparisons. Are there any scaling > factor that needs to be applied beforehand. > > I've noticed that MAP-MRI measures are very susceptible to artifacts. > > > Thank you. > > Ping > > > > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fick.rutger at gmail.com Fri Jan 5 05:53:41 2018 From: fick.rutger at gmail.com (Rutger Fick) Date: Fri, 5 Jan 2018 11:53:41 +0100 Subject: [Neuroimaging] [Dipy] MAPMRI between subject comparisons In-Reply-To: References: Message-ID: Hello Ping, It is hard to debug what you're doing without any other information about your model settings or what data you're fitting. I will just describe some possible issues that you could be running into: - MAP-MRI metrics will not be reproducible across subjects if the gradient tables of these subjects are different. Reason is that MAP-MRI is basically a non-parametric inter/extra-polator and will just smoothly attenuate to zero after the last b-value point in acquisition scheme. If this point changes between schemes, then the extrapolation begins at different points, which results in different q-space index values (because they are based on the extrapolation to infinity). Relevant references would be [1, 2], where is shown that MAPMRI qspace indices *are *reproducible between subjects (with the same scheme). - The scaling factor is calculated internally using DTI, so that should not be a user issue. It is worth looking at the fitted_mapmri_model.mu property, which contain the estimated scaling factors (ux, uy, uz). If all these factors are the same (or have been truncated to their minimum allowed value), this means there is a problem with the data itself (DTI failed to fit properly). - With respect to artifacts, I'm not sure what kind of artifacts you're seeing, but depending on the problem several things could be happening. - If you're using laplacian regularization and the data is very anisotropic, then the automatic regularization estimation using GCV could be giving a too low value. Try setting it to a fixed value (0.2 for example), or if it was already set to a fixed value, try increasing it to see what happens (but not too much because you'll just be making everything flat). - If you're not using positivity constraint as well -> use it as well. The best results are typically found when both GCV and positivity constraint are used (but it also takes the longest to fit). - Of course,if the data itself is bad (very noisy or some crazy distortion) then MAPMRI cannot do much about it. As I said above, it will just smoothly fit the data it is given. It is always important to look at the data itself you are fitting, and if you see a very badly distorted DWI, then remove it from from the data set. Let us know what kind of acquisition schemes you're using, and explain what kind of artifacts you're seeing. Hard to make a concrete judgement otherwise. Best, Rutger [1] Avram, Alexandru V., et al. "Clinical feasibility of using mean apparent propagator (MAP) MRI to characterize brain tissue microstructure." *NeuroImage* 127 (2016): 422-434. [2] Fick, Rutger HJ, et al. "MAPL: Tissue microstructure estimation using Laplacian-regularized MAP-MRI and its application to HCP data." *NeuroImage* 134 (2016): 365-385. On 5 January 2018 at 11:46, Mauro Zucchelli wrote: > Hi! Low SNR in multi-shell data with high b-values are a problem for all > the higher order models, including MAP-MRI and many compartmental models. > Moreover, MAPMRI presents numerous parameters tha you can adjust in order > to maximize its performances. Can you give us more information on your > dataset? E.g. SNR, number of samples, number of b-values, etc. > > Kind regards, > > Mauro > > On Wed, Jan 3, 2018 at 8:43 PM, Ping-Hong Yeh > wrote: > >> Hi Dipy users, >> >> I am wondering if the MAP-MRI measures such as RTOP, RTAP, RTPP, NG etc >> are ready to use for between-subject comparisons. Are there any scaling >> factor that needs to be applied beforehand. >> >> I've noticed that MAP-MRI measures are very susceptible to artifacts. >> >> >> Thank you. >> >> Ping >> >> >> >> >> _______________________________________________ >> Neuroimaging mailing list >> Neuroimaging at python.org >> https://mail.python.org/mailman/listinfo/neuroimaging >> >> > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gael.varoquaux at normalesup.org Fri Jan 5 09:46:36 2018 From: gael.varoquaux at normalesup.org (Gael Varoquaux) Date: Fri, 5 Jan 2018 15:46:36 +0100 Subject: [Neuroimaging] Plotting a Single ROI from an Atlas In-Reply-To: References: Message-ID: <20180105144636.GA2671569@phare.normalesup.org> Hi Lou, Here is code that I believe does what you want, with a bit of comments to explain briefly how it works. I suggest that you study each step to understand what it does. """ from nilearn import datasets, image, plotting # Retrieve the AAL atlas aal_atlas = datasets.fetch_atlas_aal('SPM12') # Now find the position of the Rectus_R in the list of region # labels, and use the corresponding list of indices of the image to # convert it to the index value in the map rectus_r_idx = aal_atlas.indices[aal_atlas.labels.index('Rectus_R')] # Select only the voxels of the map for which the value is equal to the # this index. rectus_r_map = image.math_img('img == %s' % rectus_r_idx, img=aal_atlas.maps) # The resulting map is a binay map that contains only the Rectus_R, we # can plot it. plotting.plot_roi(rectus_r_map, title='Rectus_R') """ Best, Ga?l On Thu, Jan 04, 2018 at 03:09:12PM -0800, Lodewijk Brand wrote: > Hi All, > I am trying to figure out a way to plot specific ROIs from an atlas in Python. > I am looking specifically at the AAL atlas: > aal_atlas = datasets.fetch_atlas_aal('SPM12') > I would like to plot individual regions (eg. 'Rectus_R', 'Insula_L', > 'Insula_R', etc.) that are specified within the atlas. I've been able to plot > the entire brain image with all the ROIs at once cannot seem to figure out how > to do each one individually. Any help/direction would be greatly appreciated!? > Best, > Lou > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging -- Gael Varoquaux Senior Researcher, INRIA Parietal NeuroSpin/CEA Saclay , Bat 145, 91191 Gif-sur-Yvette France Phone: ++ 33-1-69-08-79-68 http://gael-varoquaux.info http://twitter.com/GaelVaroquaux From pietroastolfi92 at gmail.com Tue Jan 9 20:22:36 2018 From: pietroastolfi92 at gmail.com (Pietro Astolfi) Date: Wed, 10 Jan 2018 02:22:36 +0100 Subject: [Neuroimaging] Register an image with an existing warp Message-ID: <9CBF8F8A-45EB-4504-83A9-714A909DA2A7@gmail.com> Hi All, I am trying to exploit a pre-computed warp to co-register other images. I am able to do complete this task with bash scripts that use tools provided by FSL or ANTs, but I would do the same task in python, in order to be independent from these tools (I don?t want neither to use the library dips.external.fsl). A common use-case of this task could be the transformation of an image relative to a certain subject to the MNI space, by exploiting the warp provided by the HCP dataset. I looked at the gallery of Dipy, and I only found this tutorial: http://nipy.org/dipy/examples_built/syn_registration_3d.html#example-syn-registration-3d I struggled a bit with the class DiffeomorphicMap, especially I tried to create an instance of that class in which I loaded directly the warp, but I?ve obtained only wrong results. I would be very grateful if someone could help me solving this problem, and I also suggest to add a tutorial regarding this into the Dipy gallery. Best regards, Pietro -------------- next part -------------- An HTML attachment was scrubbed... URL: From pinghongyeh at gmail.com Mon Jan 8 11:15:58 2018 From: pinghongyeh at gmail.com (Ping-Hong Yeh) Date: Mon, 8 Jan 2018 11:15:58 -0500 Subject: [Neuroimaging] [Dipy] MAPMRI between subject comparisons In-Reply-To: References: Message-ID: Hi Mauro, Rutger, Thank you both for the instructive reply. We used SMS sequence (GE 3T) to acquire multi-shell DWI (three shells b= 1000, 2000, and 3000 with 90 directions for each shell and an additional 18 volumes of b0) with an inter-slice acceleration factor of 3 and an in-plain acceleration of 2 (ASSET). The original data has N=130* 130 with an in-plain resolution of 1.7 *1.7 mm, and DWI data was registered to T2W with a final resolution of 1*1*1 mm using ANTS nonlinear warping implemented in TORTOISE toolkit for distortion correction, after running some preprocessing steps such as noise reduction, bias correction. I have not calculated the mean SNR for each shell, i think there is below 5 in b=3000. I have attached two examples of RTOP snapshots, one was created by TORTOISE, and one by DIPY using "map_model.fit" of the same data. There is a difference of a difference of scaling around 10^6 between the two, I think this is due to the difference of unit used for the DTI fitting between two tools? I am concerned about high-intensity values over the subcortical regions, such as brainstem, and inhomogeneity over the main white matter tracts such as corpus callosum. Are those seemed normal looking to you? If not, what can cause those artifacts? Are suggestions in correcting those? What even puzzles me is that i found there is a significant reduction of Principal Anisotropy in the disease group than the control group (which is not what i expected) over the frontal white matter and gray matter of insular region using voxel-wise analysis after correcting multiple comparisons. This is done by using the outputs from the TORTOISE toolkit. I am still working on the DIPY ones. Rutger, I have not tried the MAPL method yet, but i will definitely give it a shot later. What additional information or aspects does MAPL provide us, comparing to the conventional MAP-MRI method? BTW, can DIPY output Principal Anisotropy map and Non-Gaussianity map as well? If so, what is the syntax for making those? Thank you, Ping On Fri, Jan 5, 2018 at 5:53 AM, Rutger Fick wrote: > Hello Ping, > > It is hard to debug what you're doing without any other information about > your model settings or what data you're fitting. > I will just describe some possible issues that you could be running into: > > - MAP-MRI metrics will not be reproducible across subjects if the > gradient tables of these subjects are different. Reason is that MAP-MRI is > basically a non-parametric inter/extra-polator and will just smoothly > attenuate to zero after the last b-value point in acquisition scheme. If > this point changes between schemes, then the extrapolation begins at > different points, which results in different q-space index values (because > they are based on the extrapolation to infinity). Relevant references would > be [1, 2], where is shown that MAPMRI qspace indices *are *reproducible > between subjects (with the same scheme). > - The scaling factor is calculated internally using DTI, so that > should not be a user issue. It is worth looking at the > fitted_mapmri_model.mu property, which contain the estimated scaling > factors (ux, uy, uz). If all these factors are the same (or have been > truncated to their minimum allowed value), this means there is a problem > with the data itself (DTI failed to fit properly). > - With respect to artifacts, I'm not sure what kind of artifacts > you're seeing, but depending on the problem several things could be > happening. > - If you're using laplacian regularization and the data is very > anisotropic, then the automatic regularization estimation using GCV could > be giving a too low value. Try setting it to a fixed value (0.2 for > example), or if it was already set to a fixed value, try increasing it to > see what happens (but not too much because you'll just be making everything > flat). > - If you're not using positivity constraint as well -> use it as > well. The best results are typically found when both GCV and positivity > constraint are used (but it also takes the longest to fit). > - Of course,if the data itself is bad (very noisy or some crazy > distortion) then MAPMRI cannot do much about it. As I said above, it will > just smoothly fit the data it is given. It is always important to look at > the data itself you are fitting, and if you see a very badly distorted DWI, > then remove it from from the data set. > > Let us know what kind of acquisition schemes you're using, and explain > what kind of artifacts you're seeing. Hard to make a concrete judgement > otherwise. > > Best, > Rutger > > [1] Avram, Alexandru V., et al. "Clinical feasibility of using mean > apparent propagator (MAP) MRI to characterize brain tissue microstructure." > *NeuroImage* 127 (2016): 422-434. > [2] Fick, Rutger HJ, et al. "MAPL: Tissue microstructure estimation using > Laplacian-regularized MAP-MRI and its application to HCP data." > *NeuroImage* 134 (2016): 365-385. > > > > On 5 January 2018 at 11:46, Mauro Zucchelli > wrote: > >> Hi! Low SNR in multi-shell data with high b-values are a problem for all >> the higher order models, including MAP-MRI and many compartmental models. >> Moreover, MAPMRI presents numerous parameters tha you can adjust in order >> to maximize its performances. Can you give us more information on your >> dataset? E.g. SNR, number of samples, number of b-values, etc. >> >> Kind regards, >> >> Mauro >> >> On Wed, Jan 3, 2018 at 8:43 PM, Ping-Hong Yeh >> wrote: >> >>> Hi Dipy users, >>> >>> I am wondering if the MAP-MRI measures such as RTOP, RTAP, RTPP, NG >>> etc are ready to use for between-subject comparisons. Are there any scaling >>> factor that needs to be applied beforehand. >>> >>> I've noticed that MAP-MRI measures are very susceptible to artifacts. >>> >>> >>> Thank you. >>> >>> Ping >>> >>> >>> >>> >>> _______________________________________________ >>> Neuroimaging mailing list >>> Neuroimaging at python.org >>> https://mail.python.org/mailman/listinfo/neuroimaging >>> >>> >> >> _______________________________________________ >> Neuroimaging mailing list >> Neuroimaging at python.org >> https://mail.python.org/mailman/listinfo/neuroimaging >> >> > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TORTOISE_mapmri_RTOP.png Type: image/png Size: 108499 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: dipy_mapmri_RTOP.png Type: image/png Size: 120713 bytes Desc: not available URL: From elef at indiana.edu Thu Jan 11 11:52:33 2018 From: elef at indiana.edu (Eleftherios Garyfallidis) Date: Thu, 11 Jan 2018 16:52:33 +0000 Subject: [Neuroimaging] GSoC 2018 - DIPY Message-ID: Hello DIPY developers, We are planning to participate in GSoC this year. We have started a wiki page. https://github.com/nipy/dipy/wiki/Google-Summer-of-Code-2018 Send me an email if you want to be a mentor and be happy to suggest or lead new projects for this year. Best regards, Eleftherios -------------- next part -------------- An HTML attachment was scrubbed... URL: From pinghongyeh at gmail.com Fri Jan 12 10:49:41 2018 From: pinghongyeh at gmail.com (Ping-Hong Yeh) Date: Fri, 12 Jan 2018 10:49:41 -0500 Subject: [Neuroimaging] [DIPY] propagator anisotropy estimation using MAP(L)MRI Message-ID: Hi DIPY users, I would like to know the way of estimating non-Gaussian and PA, mentioned in the Avram et al. ?Clinical feasibility of using mean apparent propagator (MAP) MRI to characterize brain tissue microstructure? paper, using MAPMRI or MAPL model. Thank you. Ping -------------- next part -------------- An HTML attachment was scrubbed... URL: From fick.rutger at gmail.com Fri Jan 12 15:21:12 2018 From: fick.rutger at gmail.com (Rutger Fick) Date: Fri, 12 Jan 2018 21:21:12 +0100 Subject: [Neuroimaging] [DIPY] propagator anisotropy estimation using MAP(L)MRI In-Reply-To: References: Message-ID: Hi Ping, MAPL is just a name for using laplacian-regularized MAP-MRI. If you're using the dipy mapmri implementation then you're using MAPL by default. >From a fitted mapmri model you can estimate overall non-gaussianity using fitted_model.ng(), and parallel and perpendicular non-Gaussianity using ng_parallel() and ng_perpendicperpendicularular(). Propagator Anisotropic is not included in the current dipy implementation. However, I do have a personal version of dipy's mapmri implementation that includes it, if you're interested. Best, Rutger On 12 January 2018 at 16:49, Ping-Hong Yeh wrote: > Hi DIPY users, > > I would like to know the way of estimating non-Gaussian and PA, mentioned > in the Avram et al. ?Clinical feasibility of using mean apparent > propagator (MAP) MRI to characterize brain tissue microstructure? paper, > using MAPMRI or MAPL model. > > Thank you. > > Ping > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pinghongyeh at gmail.com Fri Jan 12 15:48:36 2018 From: pinghongyeh at gmail.com (Ping-Hong Yeh) Date: Fri, 12 Jan 2018 15:48:36 -0500 Subject: [Neuroimaging] [DIPY] propagator anisotropy estimation using MAP(L)MRI In-Reply-To: References: Message-ID: Hi Roger, Thanks for the prompt reply. May I have the code for estimating PA? Ping On Jan 12, 2018 3:21 PM, "Rutger Fick" wrote: > Hi Ping, > > MAPL is just a name for using laplacian-regularized MAP-MRI. If you're > using the dipy mapmri implementation then you're using MAPL by default. > From a fitted mapmri model you can estimate overall non-gaussianity using > fitted_model.ng(), and parallel and perpendicular non-Gaussianity using > ng_parallel() and ng_perpendicperpendicularular(). > Propagator Anisotropic is not included in the current dipy implementation. > However, I do have a personal version of dipy's mapmri implementation that > includes it, if you're interested. > > Best, > Rutger > > On 12 January 2018 at 16:49, Ping-Hong Yeh wrote: > >> Hi DIPY users, >> >> I would like to know the way of estimating non-Gaussian and PA, >> mentioned in the Avram et al. ?Clinical feasibility of using mean >> apparent propagator (MAP) MRI to characterize brain tissue microstructure? >> paper, using MAPMRI or MAPL model. >> >> Thank you. >> >> Ping >> >> _______________________________________________ >> Neuroimaging mailing list >> Neuroimaging at python.org >> https://mail.python.org/mailman/listinfo/neuroimaging >> >> > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fick.rutger at gmail.com Fri Jan 12 18:40:33 2018 From: fick.rutger at gmail.com (Rutger Fick) Date: Sat, 13 Jan 2018 00:40:33 +0100 Subject: [Neuroimaging] [Dipy] MAPMRI between subject comparisons In-Reply-To: References: Message-ID: Hi Ping, All I can say is that dipy's RTOP is in 1/mm^3, I don't know about TORTOISE. Looking at the images it looks like TORTOISE's RTOP estimation has some areas that produced negative values (black patches in the middle of the bright white areas in the middle of the left image). This indicates their regularization is failing. On the other hand, I think maybe you can tweak dipy's mapmri settings to make the RTOP estimation look even better. Try the following setting: mapmod = mapmri.MapmriModel(gtab, laplacian_regularization=True, # this regularization enhances reproducibility of estimated q-space indices by imposing smoothness laplacian_weighting="GCV", # this makes it use generalized cross-validation to find the best regularization weight positivity_constraint=True) # this ensures the estimated PDF is positive MAPL is just a name for imposing signal smoothness during MAP-MRI's signal fitting, which is in fact the default setting when you fit dipy's mapmri ( so you've already been using it). The general idea is that imposing a bit of smoothness in MAP-MRI's signal reconstruction will make estimation of q-space indices (RTOP RTAP NG etc.) more robust. The "GCV" option makes the weight selection of the laplacian-regularization data dependent using generalized cross-validation. Setting positivity_constraint=True then also forces the solution to have a positive PDF, which was the original approach by Ozarslan et al (2013). Using both MAPL and positivity should then give you the best possible reconstruction of RTOP and others. The relevant citation for the positivity constraint is [1], while for MAPL is [2]. Just cite both those papers when you use dipy's implementation :-) Best, Rutger [1] ?zarslan, Evren, et al. "Mean apparent propagator (MAP) MRI: a novel diffusion imaging method for mapping tissue microstructure." *NeuroImage* 78 (2013): 16-32. [2] Fick, Rutger HJ, et al. "MAPL: Tissue microstructure estimation using Laplacian-regularized MAP-MRI and its application to HCP data." *NeuroImage* 134 (2016): 365-385. On 8 January 2018 at 17:15, Ping-Hong Yeh wrote: > Hi Mauro, Rutger, > > Thank you both for the instructive reply. > > We used SMS sequence (GE 3T) to acquire multi-shell DWI (three shells b= > 1000, 2000, and 3000 with 90 directions for each shell and an additional 18 > volumes of b0) with an inter-slice acceleration factor of 3 and an in-plain > acceleration of 2 (ASSET). The original data has N=130* 130 with an > in-plain resolution of 1.7 *1.7 mm, and DWI data was registered to T2W with > a final resolution of 1*1*1 mm using ANTS nonlinear warping implemented > in TORTOISE toolkit for distortion correction, after running some > preprocessing steps such as noise reduction, bias correction. > > I have not calculated the mean SNR for each shell, i think there is below > 5 in b=3000. > > I have attached two examples of RTOP snapshots, one was created by > TORTOISE, and one by DIPY using "map_model.fit" of the same data. There > is a difference of a difference of scaling around 10^6 between the two, I > think this is due to the difference of unit used for the DTI fitting > between two tools? > > I am concerned about high-intensity values over the subcortical regions, > such as brainstem, and inhomogeneity over the main white matter tracts such > as corpus callosum. Are those seemed normal looking to you? If not, what > can cause those artifacts? Are suggestions in correcting those? > > What even puzzles me is that i found there is a significant reduction of > Principal Anisotropy in the disease group than the control group (which > is not what i expected) over the frontal white matter and gray matter of > insular region using voxel-wise analysis after correcting multiple > comparisons. This is done by using the outputs from the TORTOISE toolkit. I > am still working on the DIPY ones. > > > Rutger, > > I have not tried the MAPL method yet, but i will definitely give it a shot > later. What additional information or aspects does MAPL provide us, > comparing to the conventional MAP-MRI method? BTW, can DIPY output Principal > Anisotropy map and Non-Gaussianity map as well? If so, what is the syntax > for making those? > > Thank you, > > Ping > > > On Fri, Jan 5, 2018 at 5:53 AM, Rutger Fick wrote: > >> Hello Ping, >> >> It is hard to debug what you're doing without any other information about >> your model settings or what data you're fitting. >> I will just describe some possible issues that you could be running into: >> >> - MAP-MRI metrics will not be reproducible across subjects if the >> gradient tables of these subjects are different. Reason is that MAP-MRI is >> basically a non-parametric inter/extra-polator and will just smoothly >> attenuate to zero after the last b-value point in acquisition scheme. If >> this point changes between schemes, then the extrapolation begins at >> different points, which results in different q-space index values (because >> they are based on the extrapolation to infinity). Relevant references would >> be [1, 2], where is shown that MAPMRI qspace indices *are *reproducible >> between subjects (with the same scheme). >> - The scaling factor is calculated internally using DTI, so that >> should not be a user issue. It is worth looking at the >> fitted_mapmri_model.mu property, which contain the estimated scaling >> factors (ux, uy, uz). If all these factors are the same (or have been >> truncated to their minimum allowed value), this means there is a problem >> with the data itself (DTI failed to fit properly). >> - With respect to artifacts, I'm not sure what kind of artifacts >> you're seeing, but depending on the problem several things could be >> happening. >> - If you're using laplacian regularization and the data is very >> anisotropic, then the automatic regularization estimation using GCV could >> be giving a too low value. Try setting it to a fixed value (0.2 for >> example), or if it was already set to a fixed value, try increasing it to >> see what happens (but not too much because you'll just be making everything >> flat). >> - If you're not using positivity constraint as well -> use it as >> well. The best results are typically found when both GCV and positivity >> constraint are used (but it also takes the longest to fit). >> - Of course,if the data itself is bad (very noisy or some crazy >> distortion) then MAPMRI cannot do much about it. As I said above, it will >> just smoothly fit the data it is given. It is always important to look at >> the data itself you are fitting, and if you see a very badly distorted DWI, >> then remove it from from the data set. >> >> Let us know what kind of acquisition schemes you're using, and explain >> what kind of artifacts you're seeing. Hard to make a concrete judgement >> otherwise. >> >> Best, >> Rutger >> >> [1] Avram, Alexandru V., et al. "Clinical feasibility of using mean >> apparent propagator (MAP) MRI to characterize brain tissue microstructure." >> *NeuroImage* 127 (2016): 422-434. >> [2] Fick, Rutger HJ, et al. "MAPL: Tissue microstructure estimation using >> Laplacian-regularized MAP-MRI and its application to HCP data." >> *NeuroImage* 134 (2016): 365-385. >> >> >> >> On 5 January 2018 at 11:46, Mauro Zucchelli >> wrote: >> >>> Hi! Low SNR in multi-shell data with high b-values are a problem for all >>> the higher order models, including MAP-MRI and many compartmental models. >>> Moreover, MAPMRI presents numerous parameters tha you can adjust in >>> order to maximize its performances. Can you give us more information on >>> your dataset? E.g. SNR, number of samples, number of b-values, etc. >>> >>> Kind regards, >>> >>> Mauro >>> >>> On Wed, Jan 3, 2018 at 8:43 PM, Ping-Hong Yeh >>> wrote: >>> >>>> Hi Dipy users, >>>> >>>> I am wondering if the MAP-MRI measures such as RTOP, RTAP, RTPP, NG >>>> etc are ready to use for between-subject comparisons. Are there any scaling >>>> factor that needs to be applied beforehand. >>>> >>>> I've noticed that MAP-MRI measures are very susceptible to artifacts. >>>> >>>> >>>> Thank you. >>>> >>>> Ping >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> Neuroimaging mailing list >>>> Neuroimaging at python.org >>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>> >>>> >>> >>> _______________________________________________ >>> Neuroimaging mailing list >>> Neuroimaging at python.org >>> https://mail.python.org/mailman/listinfo/neuroimaging >>> >>> >> >> _______________________________________________ >> Neuroimaging mailing list >> Neuroimaging at python.org >> https://mail.python.org/mailman/listinfo/neuroimaging >> >> > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fick.rutger at gmail.com Fri Jan 12 18:24:33 2018 From: fick.rutger at gmail.com (Rutger Fick) Date: Sat, 13 Jan 2018 00:24:33 +0100 Subject: [Neuroimaging] [DIPY] propagator anisotropy estimation using MAP(L)MRI In-Reply-To: References: Message-ID: Hi Ping, Attached is the mapmri code that also has PA, just put it in the dipy/reconst/ folder (where also the current mapmri.py file is) and run "python setup.py install" from dipy's main folder. That should make it usable in the same way as the current mapmri module. Note that its based on an old implementation that still works with the "cvxopt" optimizer package, so you'll have to install cvxopt to make it run. I recommend you use the model with both laplacian regularization and positivity constraint, this give the best results in general. from dipy.reconst import mapmri_pa mapmod = mapmri_pa.MapmriModel(gtab, laplacian_regularization=True, # this regularization enhances reproducibility of estimated q-space indices by imposing smoothness laplacian_weighting="GCV", # this makes it use generalized cross-validation to find the best regularization weight positivity_constraint=True) # this ensures the estimated PDF is positive mapfit = mapmod.fit(data) pa = mapfit.pa() Aside from the original MAPMRI citation for Ozarslan et al. (2013), note that the relevant citation for dipy's laplacian-regularized MAP-MRI implementation is [1]. [1] Fick, Rutger HJ, et al. "MAPL: Tissue microstructure estimation using Laplacian-regularized MAP-MRI and its application to HCP data." *NeuroImage* 134 (2016): 365-385. Hope it helps and let me know if you need anything else, Rutger On 12 January 2018 at 21:48, Ping-Hong Yeh wrote: > Hi Roger, > > Thanks for the prompt reply. > May I have the code for estimating PA? > > Ping > > On Jan 12, 2018 3:21 PM, "Rutger Fick" wrote: > >> Hi Ping, >> >> MAPL is just a name for using laplacian-regularized MAP-MRI. If you're >> using the dipy mapmri implementation then you're using MAPL by default. >> From a fitted mapmri model you can estimate overall non-gaussianity using >> fitted_model.ng(), and parallel and perpendicular non-Gaussianity using >> ng_parallel() and ng_perpendicperpendicularular(). >> Propagator Anisotropic is not included in the current dipy >> implementation. However, I do have a personal version of dipy's mapmri >> implementation that includes it, if you're interested. >> >> Best, >> Rutger >> >> On 12 January 2018 at 16:49, Ping-Hong Yeh wrote: >> >>> Hi DIPY users, >>> >>> I would like to know the way of estimating non-Gaussian and PA, >>> mentioned in the Avram et al. ?Clinical feasibility of using mean >>> apparent propagator (MAP) MRI to characterize brain tissue microstructure? >>> paper, using MAPMRI or MAPL model. >>> >>> Thank you. >>> >>> Ping >>> >>> _______________________________________________ >>> Neuroimaging mailing list >>> Neuroimaging at python.org >>> https://mail.python.org/mailman/listinfo/neuroimaging >>> >>> >> >> _______________________________________________ >> Neuroimaging mailing list >> Neuroimaging at python.org >> https://mail.python.org/mailman/listinfo/neuroimaging >> >> > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mapmri_pa.py Type: text/x-python Size: 87817 bytes Desc: not available URL: From pinghongyeh at gmail.com Fri Jan 12 22:20:42 2018 From: pinghongyeh at gmail.com (Ping-Hong Yeh) Date: Fri, 12 Jan 2018 22:20:42 -0500 Subject: [Neuroimaging] [DIPY] propagator anisotropy estimation using MAP(L)MRI In-Reply-To: References: Message-ID: Hi Rutger, Thank you so much for the code and detailed explanation. I'll try it out next week when I get back to work. Have a nice weekend. Ping On Jan 12, 2018 7:03 PM, "Rutger Fick" wrote: Hi Ping, Attached is the mapmri code that also has PA, just put it in the dipy/reconst/ folder (where also the current mapmri.py file is) and run "python setup.py install" from dipy's main folder. That should make it usable in the same way as the current mapmri module. Note that its based on an old implementation that still works with the "cvxopt" optimizer package, so you'll have to install cvxopt to make it run. I recommend you use the model with both laplacian regularization and positivity constraint, this give the best results in general. from dipy.reconst import mapmri_pa mapmod = mapmri_pa.MapmriModel(gtab, laplacian_regularization=True, # this regularization enhances reproducibility of estimated q-space indices by imposing smoothness laplacian_weighting="GCV", # this makes it use generalized cross-validation to find the best regularization weight positivity_constraint=True) # this ensures the estimated PDF is positive mapfit = mapmod.fit(data) pa = mapfit.pa() Aside from the original MAPMRI citation for Ozarslan et al. (2013), note that the relevant citation for dipy's laplacian-regularized MAP-MRI implementation is [1]. [1] Fick, Rutger HJ, et al. "MAPL: Tissue microstructure estimation using Laplacian-regularized MAP-MRI and its application to HCP data." *NeuroImage* 134 (2016): 365-385. Hope it helps and let me know if you need anything else, Rutger On 12 January 2018 at 21:48, Ping-Hong Yeh wrote: > Hi Roger, > > Thanks for the prompt reply. > May I have the code for estimating PA? > > Ping > > On Jan 12, 2018 3:21 PM, "Rutger Fick" wrote: > >> Hi Ping, >> >> MAPL is just a name for using laplacian-regularized MAP-MRI. If you're >> using the dipy mapmri implementation then you're using MAPL by default. >> From a fitted mapmri model you can estimate overall non-gaussianity using >> fitted_model.ng(), and parallel and perpendicular non-Gaussianity using >> ng_parallel() and ng_perpendicperpendicularular(). >> Propagator Anisotropic is not included in the current dipy >> implementation. However, I do have a personal version of dipy's mapmri >> implementation that includes it, if you're interested. >> >> Best, >> Rutger >> >> On 12 January 2018 at 16:49, Ping-Hong Yeh wrote: >> >>> Hi DIPY users, >>> >>> I would like to know the way of estimating non-Gaussian and PA, >>> mentioned in the Avram et al. ?Clinical feasibility of using mean >>> apparent propagator (MAP) MRI to characterize brain tissue microstructure? >>> paper, using MAPMRI or MAPL model. >>> >>> Thank you. >>> >>> Ping >>> >>> _______________________________________________ >>> Neuroimaging mailing list >>> Neuroimaging at python.org >>> https://mail.python.org/mailman/listinfo/neuroimaging >>> >>> >> >> _______________________________________________ >> Neuroimaging mailing list >> Neuroimaging at python.org >> https://mail.python.org/mailman/listinfo/neuroimaging >> >> > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > > _______________________________________________ Neuroimaging mailing list Neuroimaging at python.org https://mail.python.org/mailman/listinfo/neuroimaging -------------- next part -------------- An HTML attachment was scrubbed... URL: From pinghongyeh at gmail.com Tue Jan 16 17:46:50 2018 From: pinghongyeh at gmail.com (Ping-Hong Yeh) Date: Tue, 16 Jan 2018 17:46:50 -0500 Subject: [Neuroimaging] [DIPY] propagator anisotropy estimation using MAP(L)MRI In-Reply-To: References: Message-ID: Hi Rutger, I got an error running the map_model.fit using mapmri_pa. Here is the scripts i used, map_model_L = mapmri_pa.MapmriModel(gtab, radial_order=radial_order, laplacian_regularization=True, # this regularization enhances reproducibility of estimated q-space indices by imposing smoothness laplacian_weighting="GCV", # this makes it use generalized cross-validation to find the best regularization weight positivity_constraint=True) # this ensures the estimated PDF is positive mapfit_L = map_model_L.fit(data) , and the error message, /Library/Python/2.7/site-packages/dipy/core/geometry.py:129: RuntimeWarning: invalid value encountered in true_divide theta = np.arccos(z / r) /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:364: UserWarning: The MAPMRI positivity constraint depends on CVXOPT (http: xopt.org/). CVXOPT is licensed under the GPL (see: http://cvxopt.org/copyright.html) and you may be subject to this license when using positivity constraint. warn(w_s) /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:389: RuntimeWarning: invalid value encountered in divide data = np.asarray(data / data[self.gtab.b0s_mask].mean()) /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:413: UserWarning: Optimization did not find a solution warn('Optimization did not find a solution') /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:444: UserWarning: Optimization did not find a solution warn('Optimization did not find a solution') Traceback (most recent call last): File "", line 1, in File "/Library/Python/2.7/site-packages/dipy/reconst/multi_voxel.py", line 33, in new_fit fit_array[ijk] = single_voxel_fit(self, data[ijk]) File "/Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py", line 465, in fit coef_iso = coef_iso / sum(coef_iso * self.Bm_iso) UnboundLocalError: local variable 'coef_iso' referenced before assignment Any suggestions? Thank you. ping On Fri, Jan 12, 2018 at 6:24 PM, Rutger Fick wrote: > Hi Ping, > > Attached is the mapmri code that also has PA, just put it in the > dipy/reconst/ folder (where also the current mapmri.py file is) and run > "python setup.py install" from dipy's main folder. That should make it > usable in the same way as the current mapmri module. > Note that its based on an old implementation that still works with the > "cvxopt" optimizer package, so you'll have to install cvxopt to make it run. > > I recommend you use the model with both laplacian regularization and > positivity constraint, this give the best results in general. > > from dipy.reconst import mapmri_pa > mapmod = mapmri_pa.MapmriModel(gtab, > laplacian_regularization=True, # this > regularization enhances reproducibility of estimated q-space indices by > imposing smoothness > laplacian_weighting="GCV", # this makes it > use generalized cross-validation to find the best regularization weight > positivity_constraint=True) # this ensures > the estimated PDF is positive > mapfit = mapmod.fit(data) > pa = mapfit.pa() > > Aside from the original MAPMRI citation for Ozarslan et al. (2013), note > that the relevant citation for dipy's laplacian-regularized MAP-MRI > implementation is [1]. > [1] Fick, Rutger HJ, et al. "MAPL: Tissue microstructure estimation using > Laplacian-regularized MAP-MRI and its application to HCP data." > *NeuroImage* 134 (2016): 365-385. > > Hope it helps and let me know if you need anything else, > Rutger > > > On 12 January 2018 at 21:48, Ping-Hong Yeh wrote: > >> Hi Roger, >> >> Thanks for the prompt reply. >> May I have the code for estimating PA? >> >> Ping >> >> On Jan 12, 2018 3:21 PM, "Rutger Fick" wrote: >> >>> Hi Ping, >>> >>> MAPL is just a name for using laplacian-regularized MAP-MRI. If you're >>> using the dipy mapmri implementation then you're using MAPL by default. >>> From a fitted mapmri model you can estimate overall non-gaussianity >>> using fitted_model.ng(), and parallel and perpendicular non-Gaussianity >>> using ng_parallel() and ng_perpendicperpendicularular(). >>> Propagator Anisotropic is not included in the current dipy >>> implementation. However, I do have a personal version of dipy's mapmri >>> implementation that includes it, if you're interested. >>> >>> Best, >>> Rutger >>> >>> On 12 January 2018 at 16:49, Ping-Hong Yeh >>> wrote: >>> >>>> Hi DIPY users, >>>> >>>> I would like to know the way of estimating non-Gaussian and PA, >>>> mentioned in the Avram et al. ?Clinical feasibility of using mean >>>> apparent propagator (MAP) MRI to characterize brain tissue microstructure? >>>> paper, using MAPMRI or MAPL model. >>>> >>>> Thank you. >>>> >>>> Ping >>>> >>>> _______________________________________________ >>>> Neuroimaging mailing list >>>> Neuroimaging at python.org >>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>> >>>> >>> >>> _______________________________________________ >>> Neuroimaging mailing list >>> Neuroimaging at python.org >>> https://mail.python.org/mailman/listinfo/neuroimaging >>> >>> >> _______________________________________________ >> Neuroimaging mailing list >> Neuroimaging at python.org >> https://mail.python.org/mailman/listinfo/neuroimaging >> >> > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fick.rutger at gmail.com Tue Jan 16 19:18:35 2018 From: fick.rutger at gmail.com (Rutger Fick) Date: Wed, 17 Jan 2018 01:18:35 +0100 Subject: [Neuroimaging] [DIPY] propagator anisotropy estimation using MAP(L)MRI In-Reply-To: References: Message-ID: Hi Ping, Reading the error messages, it looks like you're fitting a masked voxel. The following error: /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:389: RuntimeWarning: invalid value encountered in divide data = np.asarray(data / data[self.gtab.b0s_mask].mean()) says you're dividing by either zero or NaN, which means your b0 value of that voxel was zero (or you had no b0 values possibly). Note that mapmri needs at least one b0 measurement. I recommend you check if it works when you fit a voxel that you know for sure is in white matter. If it works, you can do something like map_model_L.fit(data, mask=data[..., 0]>0) to use a mask that only fits if the first measured DWI is positive (assuming your first measurement is a b0). Best, Rutger On 16 January 2018 at 23:46, Ping-Hong Yeh wrote: > Hi Rutger, > > I got an error running the map_model.fit using mapmri_pa. Here is the > scripts i used, > > > map_model_L = mapmri_pa.MapmriModel(gtab, radial_order=radial_order, > laplacian_regularization=True, # this > regularization enhances reproducibility of estimated q-space indices by > imposing smoothness > laplacian_weighting="GCV", # this makes it > use generalized cross-validation to find the best regularization weight > positivity_constraint=True) # this ensures > the estimated PDF is positive > > mapfit_L = map_model_L.fit(data) > > , and the error message, > > > /Library/Python/2.7/site-packages/dipy/core/geometry.py:129: > RuntimeWarning: invalid value encountered in true_divide > theta = np.arccos(z / r) > /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:364: > UserWarning: The MAPMRI positivity constraint depends on CVXOPT (http: > xopt.org/). CVXOPT is licensed under the GPL (see: > http://cvxopt.org/copyright.html) and you may be subject to this license > when using positivity constraint. > warn(w_s) > /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:389: > RuntimeWarning: invalid value encountered in divide > data = np.asarray(data / data[self.gtab.b0s_mask].mean()) > /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:413: > UserWarning: Optimization did not find a solution > warn('Optimization did not find a solution') > /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:444: > UserWarning: Optimization did not find a solution > warn('Optimization did not find a solution') > Traceback (most recent call last): > File "", line 1, in > File "/Library/Python/2.7/site-packages/dipy/reconst/multi_voxel.py", > line 33, in new_fit > fit_array[ijk] = single_voxel_fit(self, data[ijk]) > File "/Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py", > line 465, in fit > coef_iso = coef_iso / sum(coef_iso * self.Bm_iso) > UnboundLocalError: local variable 'coef_iso' referenced before assignment > > > Any suggestions? > > Thank you. > > ping > > On Fri, Jan 12, 2018 at 6:24 PM, Rutger Fick > wrote: > >> Hi Ping, >> >> Attached is the mapmri code that also has PA, just put it in the >> dipy/reconst/ folder (where also the current mapmri.py file is) and run >> "python setup.py install" from dipy's main folder. That should make it >> usable in the same way as the current mapmri module. >> Note that its based on an old implementation that still works with the >> "cvxopt" optimizer package, so you'll have to install cvxopt to make it run. >> >> I recommend you use the model with both laplacian regularization and >> positivity constraint, this give the best results in general. >> >> from dipy.reconst import mapmri_pa >> mapmod = mapmri_pa.MapmriModel(gtab, >> laplacian_regularization=True, # this >> regularization enhances reproducibility of estimated q-space indices by >> imposing smoothness >> laplacian_weighting="GCV", # this makes >> it use generalized cross-validation to find the best regularization weight >> positivity_constraint=True) # this >> ensures the estimated PDF is positive >> mapfit = mapmod.fit(data) >> pa = mapfit.pa() >> >> Aside from the original MAPMRI citation for Ozarslan et al. (2013), note >> that the relevant citation for dipy's laplacian-regularized MAP-MRI >> implementation is [1]. >> [1] Fick, Rutger HJ, et al. "MAPL: Tissue microstructure estimation using >> Laplacian-regularized MAP-MRI and its application to HCP data." >> *NeuroImage* 134 (2016): 365-385. >> >> Hope it helps and let me know if you need anything else, >> Rutger >> >> >> On 12 January 2018 at 21:48, Ping-Hong Yeh wrote: >> >>> Hi Roger, >>> >>> Thanks for the prompt reply. >>> May I have the code for estimating PA? >>> >>> Ping >>> >>> On Jan 12, 2018 3:21 PM, "Rutger Fick" wrote: >>> >>>> Hi Ping, >>>> >>>> MAPL is just a name for using laplacian-regularized MAP-MRI. If you're >>>> using the dipy mapmri implementation then you're using MAPL by default. >>>> From a fitted mapmri model you can estimate overall non-gaussianity >>>> using fitted_model.ng(), and parallel and perpendicular non-Gaussianity >>>> using ng_parallel() and ng_perpendicperpendicularular(). >>>> Propagator Anisotropic is not included in the current dipy >>>> implementation. However, I do have a personal version of dipy's mapmri >>>> implementation that includes it, if you're interested. >>>> >>>> Best, >>>> Rutger >>>> >>>> On 12 January 2018 at 16:49, Ping-Hong Yeh >>>> wrote: >>>> >>>>> Hi DIPY users, >>>>> >>>>> I would like to know the way of estimating non-Gaussian and PA, >>>>> mentioned in the Avram et al. ?Clinical feasibility of using mean >>>>> apparent propagator (MAP) MRI to characterize brain tissue microstructure? >>>>> paper, using MAPMRI or MAPL model. >>>>> >>>>> Thank you. >>>>> >>>>> Ping >>>>> >>>>> _______________________________________________ >>>>> Neuroimaging mailing list >>>>> Neuroimaging at python.org >>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Neuroimaging mailing list >>>> Neuroimaging at python.org >>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>> >>>> >>> _______________________________________________ >>> Neuroimaging mailing list >>> Neuroimaging at python.org >>> https://mail.python.org/mailman/listinfo/neuroimaging >>> >>> >> >> _______________________________________________ >> Neuroimaging mailing list >> Neuroimaging at python.org >> https://mail.python.org/mailman/listinfo/neuroimaging >> >> > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pinghongyeh at gmail.com Wed Jan 17 18:58:43 2018 From: pinghongyeh at gmail.com (Ping-Hong Yeh) Date: Wed, 17 Jan 2018 18:58:43 -0500 Subject: [Neuroimaging] [DIPY] propagator anisotropy estimation using MAP(L)MRI In-Reply-To: References: Message-ID: Hi Rutger, Thanks again for the prompt reply. Adding "mask" to mapmri have fixed the error; however, another error shows up, mapfit_L = map_model_L.fit(data,mask=data[..., 0]>0) dipy/core/geometry.py:129: RuntimeWarning: invalid value encountered in true_divide theta = np.arccos(z / r) dipy/reconst/mapmri_pa.py:364: UserWarning: The MAPMRI positivity constraint depends on CVXOPT (http://cvxopt.org/). CVXOPT is licensed under the GPL (see: http://cvxopt.org/copyright.html) and you may be subject to this license when using the positivity constraint. warn(w_s) dipy/reconst/mapmri_pa.py:413: UserWarning: Optimization did not find a solution warn('Optimization did not find a solution') Error: Couldn't find per display information It is still running though. Should i stop the running? Thank you. ping On Tue, Jan 16, 2018 at 7:18 PM, Rutger Fick wrote: > Hi Ping, > > Reading the error messages, it looks like you're fitting a masked voxel. > The following error: > > /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:389: > RuntimeWarning: invalid value encountered in divide > data = np.asarray(data / data[self.gtab.b0s_mask].mean()) > > says you're dividing by either zero or NaN, which means your b0 value of > that voxel was zero (or you had no b0 values possibly). Note that mapmri > needs at least one b0 measurement. > I recommend you check if it works when you fit a voxel that you know for > sure is in white matter. If it works, you can do something like > map_model_L.fit(data, mask=data[..., 0]>0) to use a mask that only fits > if the first measured DWI is positive (assuming your first measurement is a > b0). > > Best, > Rutger > > > > On 16 January 2018 at 23:46, Ping-Hong Yeh wrote: > >> Hi Rutger, >> >> I got an error running the map_model.fit using mapmri_pa. Here is the >> scripts i used, >> >> >> map_model_L = mapmri_pa.MapmriModel(gtab, radial_order=radial_order, >> laplacian_regularization=True, # this >> regularization enhances reproducibility of estimated q-space indices by >> imposing smoothness >> laplacian_weighting="GCV", # this makes >> it use generalized cross-validation to find the best regularization weight >> positivity_constraint=True) # this >> ensures the estimated PDF is positive >> >> mapfit_L = map_model_L.fit(data) >> >> , and the error message, >> >> >> /Library/Python/2.7/site-packages/dipy/core/geometry.py:129: >> RuntimeWarning: invalid value encountered in true_divide >> theta = np.arccos(z / r) >> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:364: >> UserWarning: The MAPMRI positivity constraint depends on CVXOPT (http: >> xopt.org/). CVXOPT is licensed under the GPL (see: >> http://cvxopt.org/copyright.html) and you may be subject to this license >> when using positivity constraint. >> warn(w_s) >> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:389: >> RuntimeWarning: invalid value encountered in divide >> data = np.asarray(data / data[self.gtab.b0s_mask].mean()) >> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:413: >> UserWarning: Optimization did not find a solution >> warn('Optimization did not find a solution') >> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:444: >> UserWarning: Optimization did not find a solution >> warn('Optimization did not find a solution') >> Traceback (most recent call last): >> File "", line 1, in >> File "/Library/Python/2.7/site-packages/dipy/reconst/multi_voxel.py", >> line 33, in new_fit >> fit_array[ijk] = single_voxel_fit(self, data[ijk]) >> File "/Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py", >> line 465, in fit >> coef_iso = coef_iso / sum(coef_iso * self.Bm_iso) >> UnboundLocalError: local variable 'coef_iso' referenced before assignment >> >> >> Any suggestions? >> >> Thank you. >> >> ping >> >> On Fri, Jan 12, 2018 at 6:24 PM, Rutger Fick >> wrote: >> >>> Hi Ping, >>> >>> Attached is the mapmri code that also has PA, just put it in the >>> dipy/reconst/ folder (where also the current mapmri.py file is) and run >>> "python setup.py install" from dipy's main folder. That should make it >>> usable in the same way as the current mapmri module. >>> Note that its based on an old implementation that still works with the >>> "cvxopt" optimizer package, so you'll have to install cvxopt to make it run. >>> >>> I recommend you use the model with both laplacian regularization and >>> positivity constraint, this give the best results in general. >>> >>> from dipy.reconst import mapmri_pa >>> mapmod = mapmri_pa.MapmriModel(gtab, >>> laplacian_regularization=True, # this >>> regularization enhances reproducibility of estimated q-space indices by >>> imposing smoothness >>> laplacian_weighting="GCV", # this makes >>> it use generalized cross-validation to find the best regularization weight >>> positivity_constraint=True) # this >>> ensures the estimated PDF is positive >>> mapfit = mapmod.fit(data) >>> pa = mapfit.pa() >>> >>> Aside from the original MAPMRI citation for Ozarslan et al. (2013), note >>> that the relevant citation for dipy's laplacian-regularized MAP-MRI >>> implementation is [1]. >>> [1] Fick, Rutger HJ, et al. "MAPL: Tissue microstructure estimation >>> using Laplacian-regularized MAP-MRI and its application to HCP data." >>> *NeuroImage* 134 (2016): 365-385. >>> >>> Hope it helps and let me know if you need anything else, >>> Rutger >>> >>> >>> On 12 January 2018 at 21:48, Ping-Hong Yeh >>> wrote: >>> >>>> Hi Roger, >>>> >>>> Thanks for the prompt reply. >>>> May I have the code for estimating PA? >>>> >>>> Ping >>>> >>>> On Jan 12, 2018 3:21 PM, "Rutger Fick" wrote: >>>> >>>>> Hi Ping, >>>>> >>>>> MAPL is just a name for using laplacian-regularized MAP-MRI. If you're >>>>> using the dipy mapmri implementation then you're using MAPL by default. >>>>> From a fitted mapmri model you can estimate overall non-gaussianity >>>>> using fitted_model.ng(), and parallel and perpendicular non-Gaussianity >>>>> using ng_parallel() and ng_perpendicperpendicularular(). >>>>> Propagator Anisotropic is not included in the current dipy >>>>> implementation. However, I do have a personal version of dipy's mapmri >>>>> implementation that includes it, if you're interested. >>>>> >>>>> Best, >>>>> Rutger >>>>> >>>>> On 12 January 2018 at 16:49, Ping-Hong Yeh >>>>> wrote: >>>>> >>>>>> Hi DIPY users, >>>>>> >>>>>> I would like to know the way of estimating non-Gaussian and PA, >>>>>> mentioned in the Avram et al. ?Clinical feasibility of using mean >>>>>> apparent propagator (MAP) MRI to characterize brain tissue microstructure? >>>>>> paper, using MAPMRI or MAPL model. >>>>>> >>>>>> Thank you. >>>>>> >>>>>> Ping >>>>>> >>>>>> _______________________________________________ >>>>>> Neuroimaging mailing list >>>>>> Neuroimaging at python.org >>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Neuroimaging mailing list >>>>> Neuroimaging at python.org >>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>> >>>>> >>>> _______________________________________________ >>>> Neuroimaging mailing list >>>> Neuroimaging at python.org >>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>> >>>> >>> >>> _______________________________________________ >>> Neuroimaging mailing list >>> Neuroimaging at python.org >>> https://mail.python.org/mailman/listinfo/neuroimaging >>> >>> >> >> _______________________________________________ >> Neuroimaging mailing list >> Neuroimaging at python.org >> https://mail.python.org/mailman/listinfo/neuroimaging >> >> > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From charchitsharma11 at gmail.com Wed Jan 17 03:41:44 2018 From: charchitsharma11 at gmail.com (Charchit Sharma) Date: Wed, 17 Jan 2018 14:11:44 +0530 Subject: [Neuroimaging] DIPY- GSOC Message-ID: I want to work under your organization for GSOC, are you applying this time for it. Thank You -------------- next part -------------- An HTML attachment was scrubbed... URL: From fick.rutger at gmail.com Wed Jan 17 19:48:26 2018 From: fick.rutger at gmail.com (Rutger Fick) Date: Thu, 18 Jan 2018 01:48:26 +0100 Subject: [Neuroimaging] [DIPY] propagator anisotropy estimation using MAP(L)MRI In-Reply-To: References: Message-ID: Hi Ping, If it's still running and gave only that error then probably it was just a single voxel that failed and the rest is working. However, I recommend you first try to fit a smaller dataset (just a few voxels or a single slice) just to check the results make sense. I should mention that the code I gave you is slower than Dipy's public version for reasons I won't get into, so don't worry if you have to wait longer than before. Best, Rutger On 18 Jan 2018 00:58, "Ping-Hong Yeh" wrote: > Hi Rutger, > > Thanks again for the prompt reply. > > Adding "mask" to mapmri have fixed the error; however, another error shows > up, > > mapfit_L = map_model_L.fit(data,mask=data[..., 0]>0) > dipy/core/geometry.py:129: RuntimeWarning: invalid value encountered in > true_divide > theta = np.arccos(z / r) > dipy/reconst/mapmri_pa.py:364: UserWarning: The MAPMRI positivity > constraint depends on CVXOPT (http://cvxopt.org/). CVXOPT is licensed > under the GPL (see: http://cvxopt.org/copyright.html) and you may be > subject to this license when using the positivity constraint. > warn(w_s) > dipy/reconst/mapmri_pa.py:413: UserWarning: Optimization did not find a > solution > warn('Optimization did not find a solution') > Error: Couldn't find per display information > > > It is still running though. Should i stop the running? > > Thank you. > ping > > On Tue, Jan 16, 2018 at 7:18 PM, Rutger Fick > wrote: > >> Hi Ping, >> >> Reading the error messages, it looks like you're fitting a masked voxel. >> The following error: >> >> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:389: >> RuntimeWarning: invalid value encountered in divide >> data = np.asarray(data / data[self.gtab.b0s_mask].mean()) >> >> says you're dividing by either zero or NaN, which means your b0 value of >> that voxel was zero (or you had no b0 values possibly). Note that mapmri >> needs at least one b0 measurement. >> I recommend you check if it works when you fit a voxel that you know for >> sure is in white matter. If it works, you can do something like >> map_model_L.fit(data, mask=data[..., 0]>0) to use a mask that only fits >> if the first measured DWI is positive (assuming your first measurement is a >> b0). >> >> Best, >> Rutger >> >> >> >> On 16 January 2018 at 23:46, Ping-Hong Yeh wrote: >> >>> Hi Rutger, >>> >>> I got an error running the map_model.fit using mapmri_pa. Here is the >>> scripts i used, >>> >>> >>> map_model_L = mapmri_pa.MapmriModel(gtab, radial_order=radial_order, >>> laplacian_regularization=True, # this >>> regularization enhances reproducibility of estimated q-space indices by >>> imposing smoothness >>> laplacian_weighting="GCV", # this makes >>> it use generalized cross-validation to find the best regularization weight >>> positivity_constraint=True) # this >>> ensures the estimated PDF is positive >>> >>> mapfit_L = map_model_L.fit(data) >>> >>> , and the error message, >>> >>> >>> /Library/Python/2.7/site-packages/dipy/core/geometry.py:129: >>> RuntimeWarning: invalid value encountered in true_divide >>> theta = np.arccos(z / r) >>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:364: >>> UserWarning: The MAPMRI positivity constraint depends on CVXOPT (http: >>> xopt.org/). CVXOPT is licensed under the GPL (see: >>> http://cvxopt.org/copyright.html) and you may be subject to this >>> license when using positivity constraint. >>> warn(w_s) >>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:389: >>> RuntimeWarning: invalid value encountered in divide >>> data = np.asarray(data / data[self.gtab.b0s_mask].mean()) >>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:413: >>> UserWarning: Optimization did not find a solution >>> warn('Optimization did not find a solution') >>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:444: >>> UserWarning: Optimization did not find a solution >>> warn('Optimization did not find a solution') >>> Traceback (most recent call last): >>> File "", line 1, in >>> File "/Library/Python/2.7/site-packages/dipy/reconst/multi_voxel.py", >>> line 33, in new_fit >>> fit_array[ijk] = single_voxel_fit(self, data[ijk]) >>> File "/Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py", >>> line 465, in fit >>> coef_iso = coef_iso / sum(coef_iso * self.Bm_iso) >>> UnboundLocalError: local variable 'coef_iso' referenced before assignment >>> >>> >>> Any suggestions? >>> >>> Thank you. >>> >>> ping >>> >>> On Fri, Jan 12, 2018 at 6:24 PM, Rutger Fick >>> wrote: >>> >>>> Hi Ping, >>>> >>>> Attached is the mapmri code that also has PA, just put it in the >>>> dipy/reconst/ folder (where also the current mapmri.py file is) and run >>>> "python setup.py install" from dipy's main folder. That should make it >>>> usable in the same way as the current mapmri module. >>>> Note that its based on an old implementation that still works with the >>>> "cvxopt" optimizer package, so you'll have to install cvxopt to make it run. >>>> >>>> I recommend you use the model with both laplacian regularization and >>>> positivity constraint, this give the best results in general. >>>> >>>> from dipy.reconst import mapmri_pa >>>> mapmod = mapmri_pa.MapmriModel(gtab, >>>> laplacian_regularization=True, # this >>>> regularization enhances reproducibility of estimated q-space indices by >>>> imposing smoothness >>>> laplacian_weighting="GCV", # this makes >>>> it use generalized cross-validation to find the best regularization weight >>>> positivity_constraint=True) # this >>>> ensures the estimated PDF is positive >>>> mapfit = mapmod.fit(data) >>>> pa = mapfit.pa() >>>> >>>> Aside from the original MAPMRI citation for Ozarslan et al. (2013), >>>> note that the relevant citation for dipy's laplacian-regularized MAP-MRI >>>> implementation is [1]. >>>> [1] Fick, Rutger HJ, et al. "MAPL: Tissue microstructure estimation >>>> using Laplacian-regularized MAP-MRI and its application to HCP data." >>>> *NeuroImage* 134 (2016): 365-385. >>>> >>>> Hope it helps and let me know if you need anything else, >>>> Rutger >>>> >>>> >>>> On 12 January 2018 at 21:48, Ping-Hong Yeh >>>> wrote: >>>> >>>>> Hi Roger, >>>>> >>>>> Thanks for the prompt reply. >>>>> May I have the code for estimating PA? >>>>> >>>>> Ping >>>>> >>>>> On Jan 12, 2018 3:21 PM, "Rutger Fick" wrote: >>>>> >>>>>> Hi Ping, >>>>>> >>>>>> MAPL is just a name for using laplacian-regularized MAP-MRI. If >>>>>> you're using the dipy mapmri implementation then you're using MAPL by >>>>>> default. >>>>>> From a fitted mapmri model you can estimate overall non-gaussianity >>>>>> using fitted_model.ng(), and parallel and perpendicular non-Gaussianity >>>>>> using ng_parallel() and ng_perpendicperpendicularular(). >>>>>> Propagator Anisotropic is not included in the current dipy >>>>>> implementation. However, I do have a personal version of dipy's mapmri >>>>>> implementation that includes it, if you're interested. >>>>>> >>>>>> Best, >>>>>> Rutger >>>>>> >>>>>> On 12 January 2018 at 16:49, Ping-Hong Yeh >>>>>> wrote: >>>>>> >>>>>>> Hi DIPY users, >>>>>>> >>>>>>> I would like to know the way of estimating non-Gaussian and PA, >>>>>>> mentioned in the Avram et al. ?Clinical feasibility of using mean >>>>>>> apparent propagator (MAP) MRI to characterize brain tissue microstructure? >>>>>>> paper, using MAPMRI or MAPL model. >>>>>>> >>>>>>> Thank you. >>>>>>> >>>>>>> Ping >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Neuroimaging mailing list >>>>>>> Neuroimaging at python.org >>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>> >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Neuroimaging mailing list >>>>>> Neuroimaging at python.org >>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>> >>>>>> >>>>> _______________________________________________ >>>>> Neuroimaging mailing list >>>>> Neuroimaging at python.org >>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Neuroimaging mailing list >>>> Neuroimaging at python.org >>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>> >>>> >>> >>> _______________________________________________ >>> Neuroimaging mailing list >>> Neuroimaging at python.org >>> https://mail.python.org/mailman/listinfo/neuroimaging >>> >>> >> >> _______________________________________________ >> Neuroimaging mailing list >> Neuroimaging at python.org >> https://mail.python.org/mailman/listinfo/neuroimaging >> >> > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pinghongyeh at gmail.com Fri Jan 19 11:43:49 2018 From: pinghongyeh at gmail.com (Ping-Hong Yeh) Date: Fri, 19 Jan 2018 11:43:49 -0500 Subject: [Neuroimaging] [DIPY] propagator anisotropy estimation using MAP(L)MRI In-Reply-To: References: Message-ID: Hi Rutger, Just give you an update of the results (see the attached snapshots) using GCV weighted and Laplacian regularization for MAPMRI estimation. The other PA mapping was calculated using TORTOISE. I have also attached RTOP mapping calculated using DIPY with and without GCV weighted and Laplacian regularization. Comparing to the TORTOISE, PA values in the one using GCV weighted and Laplacian regularization method are relatively smaller, particularly over the regions with the less dense white matter. For RTOP images, I am not sure whether GCV weighted and Laplacian regularization method outperforms the one without using GCV weighted and Laplacian regularization. Any comments? Thank you, ping On Wed, Jan 17, 2018 at 7:48 PM, Rutger Fick wrote: > Hi Ping, > > If it's still running and gave only that error then probably it was just a > single voxel that failed and the rest is working. However, I recommend you > first try to fit a smaller dataset (just a few voxels or a single slice) > just to check the results make sense. > > I should mention that the code I gave you is slower than Dipy's public > version for reasons I won't get into, so don't worry if you have to wait > longer than before. > > Best, > Rutger > > On 18 Jan 2018 00:58, "Ping-Hong Yeh" wrote: > >> Hi Rutger, >> >> Thanks again for the prompt reply. >> >> Adding "mask" to mapmri have fixed the error; however, another error >> shows up, >> >> mapfit_L = map_model_L.fit(data,mask=data[..., 0]>0) >> dipy/core/geometry.py:129: RuntimeWarning: invalid value encountered in >> true_divide >> theta = np.arccos(z / r) >> dipy/reconst/mapmri_pa.py:364: UserWarning: The MAPMRI positivity >> constraint depends on CVXOPT (http://cvxopt.org/). CVXOPT is licensed >> under the GPL (see: http://cvxopt.org/copyright.html) and you may be >> subject to this license when using the positivity constraint. >> warn(w_s) >> dipy/reconst/mapmri_pa.py:413: UserWarning: Optimization did not find a >> solution >> warn('Optimization did not find a solution') >> Error: Couldn't find per display information >> >> >> It is still running though. Should i stop the running? >> >> Thank you. >> ping >> >> On Tue, Jan 16, 2018 at 7:18 PM, Rutger Fick >> wrote: >> >>> Hi Ping, >>> >>> Reading the error messages, it looks like you're fitting a masked voxel. >>> The following error: >>> >>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:389: >>> RuntimeWarning: invalid value encountered in divide >>> data = np.asarray(data / data[self.gtab.b0s_mask].mean()) >>> >>> says you're dividing by either zero or NaN, which means your b0 value of >>> that voxel was zero (or you had no b0 values possibly). Note that mapmri >>> needs at least one b0 measurement. >>> I recommend you check if it works when you fit a voxel that you know for >>> sure is in white matter. If it works, you can do something like >>> map_model_L.fit(data, mask=data[..., 0]>0) to use a mask that only fits >>> if the first measured DWI is positive (assuming your first measurement is a >>> b0). >>> >>> Best, >>> Rutger >>> >>> >>> >>> On 16 January 2018 at 23:46, Ping-Hong Yeh >>> wrote: >>> >>>> Hi Rutger, >>>> >>>> I got an error running the map_model.fit using mapmri_pa. Here is the >>>> scripts i used, >>>> >>>> >>>> map_model_L = mapmri_pa.MapmriModel(gtab, radial_order=radial_order, >>>> laplacian_regularization=True, # this >>>> regularization enhances reproducibility of estimated q-space indices by >>>> imposing smoothness >>>> laplacian_weighting="GCV", # this makes >>>> it use generalized cross-validation to find the best regularization weight >>>> positivity_constraint=True) # this >>>> ensures the estimated PDF is positive >>>> >>>> mapfit_L = map_model_L.fit(data) >>>> >>>> , and the error message, >>>> >>>> >>>> /Library/Python/2.7/site-packages/dipy/core/geometry.py:129: >>>> RuntimeWarning: invalid value encountered in true_divide >>>> theta = np.arccos(z / r) >>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:364: >>>> UserWarning: The MAPMRI positivity constraint depends on CVXOPT (http: >>>> xopt.org/). CVXOPT is licensed under the GPL (see: >>>> http://cvxopt.org/copyright.html) and you may be subject to this >>>> license when using positivity constraint. >>>> warn(w_s) >>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:389: >>>> RuntimeWarning: invalid value encountered in divide >>>> data = np.asarray(data / data[self.gtab.b0s_mask].mean()) >>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:413: >>>> UserWarning: Optimization did not find a solution >>>> warn('Optimization did not find a solution') >>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:444: >>>> UserWarning: Optimization did not find a solution >>>> warn('Optimization did not find a solution') >>>> Traceback (most recent call last): >>>> File "", line 1, in >>>> File "/Library/Python/2.7/site-packages/dipy/reconst/multi_voxel.py", >>>> line 33, in new_fit >>>> fit_array[ijk] = single_voxel_fit(self, data[ijk]) >>>> File "/Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py", >>>> line 465, in fit >>>> coef_iso = coef_iso / sum(coef_iso * self.Bm_iso) >>>> UnboundLocalError: local variable 'coef_iso' referenced before >>>> assignment >>>> >>>> >>>> Any suggestions? >>>> >>>> Thank you. >>>> >>>> ping >>>> >>>> On Fri, Jan 12, 2018 at 6:24 PM, Rutger Fick >>>> wrote: >>>> >>>>> Hi Ping, >>>>> >>>>> Attached is the mapmri code that also has PA, just put it in the >>>>> dipy/reconst/ folder (where also the current mapmri.py file is) and run >>>>> "python setup.py install" from dipy's main folder. That should make it >>>>> usable in the same way as the current mapmri module. >>>>> Note that its based on an old implementation that still works with the >>>>> "cvxopt" optimizer package, so you'll have to install cvxopt to make it run. >>>>> >>>>> I recommend you use the model with both laplacian regularization and >>>>> positivity constraint, this give the best results in general. >>>>> >>>>> from dipy.reconst import mapmri_pa >>>>> mapmod = mapmri_pa.MapmriModel(gtab, >>>>> laplacian_regularization=True, # this >>>>> regularization enhances reproducibility of estimated q-space indices by >>>>> imposing smoothness >>>>> laplacian_weighting="GCV", # this >>>>> makes it use generalized cross-validation to find the best regularization >>>>> weight >>>>> positivity_constraint=True) # this >>>>> ensures the estimated PDF is positive >>>>> mapfit = mapmod.fit(data) >>>>> pa = mapfit.pa() >>>>> >>>>> Aside from the original MAPMRI citation for Ozarslan et al. (2013), >>>>> note that the relevant citation for dipy's laplacian-regularized MAP-MRI >>>>> implementation is [1]. >>>>> [1] Fick, Rutger HJ, et al. "MAPL: Tissue microstructure estimation >>>>> using Laplacian-regularized MAP-MRI and its application to HCP data." >>>>> *NeuroImage* 134 (2016): 365-385. >>>>> >>>>> Hope it helps and let me know if you need anything else, >>>>> Rutger >>>>> >>>>> >>>>> On 12 January 2018 at 21:48, Ping-Hong Yeh >>>>> wrote: >>>>> >>>>>> Hi Roger, >>>>>> >>>>>> Thanks for the prompt reply. >>>>>> May I have the code for estimating PA? >>>>>> >>>>>> Ping >>>>>> >>>>>> On Jan 12, 2018 3:21 PM, "Rutger Fick" wrote: >>>>>> >>>>>>> Hi Ping, >>>>>>> >>>>>>> MAPL is just a name for using laplacian-regularized MAP-MRI. If >>>>>>> you're using the dipy mapmri implementation then you're using MAPL by >>>>>>> default. >>>>>>> From a fitted mapmri model you can estimate overall non-gaussianity >>>>>>> using fitted_model.ng(), and parallel and perpendicular non-Gaussianity >>>>>>> using ng_parallel() and ng_perpendicperpendicularular(). >>>>>>> Propagator Anisotropic is not included in the current dipy >>>>>>> implementation. However, I do have a personal version of dipy's mapmri >>>>>>> implementation that includes it, if you're interested. >>>>>>> >>>>>>> Best, >>>>>>> Rutger >>>>>>> >>>>>>> On 12 January 2018 at 16:49, Ping-Hong Yeh >>>>>>> wrote: >>>>>>> >>>>>>>> Hi DIPY users, >>>>>>>> >>>>>>>> I would like to know the way of estimating non-Gaussian and PA, >>>>>>>> mentioned in the Avram et al. ?Clinical feasibility of using mean >>>>>>>> apparent propagator (MAP) MRI to characterize brain tissue microstructure? >>>>>>>> paper, using MAPMRI or MAPL model. >>>>>>>> >>>>>>>> Thank you. >>>>>>>> >>>>>>>> Ping >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Neuroimaging mailing list >>>>>>>> Neuroimaging at python.org >>>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Neuroimaging mailing list >>>>>>> Neuroimaging at python.org >>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>> >>>>>>> >>>>>> _______________________________________________ >>>>>> Neuroimaging mailing list >>>>>> Neuroimaging at python.org >>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Neuroimaging mailing list >>>>> Neuroimaging at python.org >>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Neuroimaging mailing list >>>> Neuroimaging at python.org >>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>> >>>> >>> >>> _______________________________________________ >>> Neuroimaging mailing list >>> Neuroimaging at python.org >>> https://mail.python.org/mailman/listinfo/neuroimaging >>> >>> >> >> _______________________________________________ >> Neuroimaging mailing list >> Neuroimaging at python.org >> https://mail.python.org/mailman/listinfo/neuroimaging >> >> > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: PA_tortoise.png Type: image/png Size: 113444 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: PA_L_dipy.png Type: image/png Size: 115232 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: rtop_dipy.png Type: image/png Size: 115634 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: rtop_L_dipy.png Type: image/png Size: 114225 bytes Desc: not available URL: From fick.rutger at gmail.com Fri Jan 19 13:25:27 2018 From: fick.rutger at gmail.com (Rutger Fick) Date: Fri, 19 Jan 2018 19:25:27 +0100 Subject: [Neuroimaging] [DIPY] propagator anisotropy estimation using MAP(L)MRI In-Reply-To: References: Message-ID: Hi Ping, So far, so good. In my opinion the TORTOISE PA reconstruction looks a bit flat/overregularized - but then again I don't know what kind of regularization they implemented for themselves. The PA of the implementation I gave you seems to give more consistent contrast for different tissue configurations - which is a good - but looks like it under-regularizes in some individual voxels (the salt-pepper noise in the PA/RTOP). To check if this is the case, can you show me the mapfit_L.norm_of_laplacian_signal() and mapfit_L.lopt maps? Rutger On 19 January 2018 at 17:43, Ping-Hong Yeh wrote: > Hi Rutger, > > Just give you an update of the results (see the attached snapshots) using > GCV weighted and Laplacian regularization for MAPMRI estimation. > > The other PA mapping was calculated using TORTOISE. I have also attached > RTOP mapping calculated using DIPY with and without GCV weighted and Laplacian > regularization. > > Comparing to the TORTOISE, PA values in the one using GCV weighted and Laplacian > regularization method are relatively smaller, particularly over the regions > with the less dense white matter. > > For RTOP images, I am not sure whether GCV weighted and Laplacian > regularization method outperforms the one without using GCV weighted and Laplacian > regularization. > > Any comments? > Thank you, > > ping > > On Wed, Jan 17, 2018 at 7:48 PM, Rutger Fick > wrote: > >> Hi Ping, >> >> If it's still running and gave only that error then probably it was just >> a single voxel that failed and the rest is working. However, I recommend >> you first try to fit a smaller dataset (just a few voxels or a single >> slice) just to check the results make sense. >> >> I should mention that the code I gave you is slower than Dipy's public >> version for reasons I won't get into, so don't worry if you have to wait >> longer than before. >> >> Best, >> Rutger >> >> On 18 Jan 2018 00:58, "Ping-Hong Yeh" wrote: >> >>> Hi Rutger, >>> >>> Thanks again for the prompt reply. >>> >>> Adding "mask" to mapmri have fixed the error; however, another error >>> shows up, >>> >>> mapfit_L = map_model_L.fit(data,mask=data[..., 0]>0) >>> dipy/core/geometry.py:129: RuntimeWarning: invalid value encountered in >>> true_divide >>> theta = np.arccos(z / r) >>> dipy/reconst/mapmri_pa.py:364: UserWarning: The MAPMRI positivity >>> constraint depends on CVXOPT (http://cvxopt.org/). CVXOPT is licensed >>> under the GPL (see: http://cvxopt.org/copyright.html) and you may be >>> subject to this license when using the positivity constraint. >>> warn(w_s) >>> dipy/reconst/mapmri_pa.py:413: UserWarning: Optimization did not find a >>> solution >>> warn('Optimization did not find a solution') >>> Error: Couldn't find per display information >>> >>> >>> It is still running though. Should i stop the running? >>> >>> Thank you. >>> ping >>> >>> On Tue, Jan 16, 2018 at 7:18 PM, Rutger Fick >>> wrote: >>> >>>> Hi Ping, >>>> >>>> Reading the error messages, it looks like you're fitting a masked >>>> voxel. The following error: >>>> >>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:389: >>>> RuntimeWarning: invalid value encountered in divide >>>> data = np.asarray(data / data[self.gtab.b0s_mask].mean()) >>>> >>>> says you're dividing by either zero or NaN, which means your b0 value >>>> of that voxel was zero (or you had no b0 values possibly). Note that mapmri >>>> needs at least one b0 measurement. >>>> I recommend you check if it works when you fit a voxel that you know >>>> for sure is in white matter. If it works, you can do something like >>>> map_model_L.fit(data, mask=data[..., 0]>0) to use a mask that only >>>> fits if the first measured DWI is positive (assuming your first measurement >>>> is a b0). >>>> >>>> Best, >>>> Rutger >>>> >>>> >>>> >>>> On 16 January 2018 at 23:46, Ping-Hong Yeh >>>> wrote: >>>> >>>>> Hi Rutger, >>>>> >>>>> I got an error running the map_model.fit using mapmri_pa. Here is the >>>>> scripts i used, >>>>> >>>>> >>>>> map_model_L = mapmri_pa.MapmriModel(gtab, radial_order=radial_order, >>>>> laplacian_regularization=True, # this >>>>> regularization enhances reproducibility of estimated q-space indices by >>>>> imposing smoothness >>>>> laplacian_weighting="GCV", # this >>>>> makes it use generalized cross-validation to find the best regularization >>>>> weight >>>>> positivity_constraint=True) # this >>>>> ensures the estimated PDF is positive >>>>> >>>>> mapfit_L = map_model_L.fit(data) >>>>> >>>>> , and the error message, >>>>> >>>>> >>>>> /Library/Python/2.7/site-packages/dipy/core/geometry.py:129: >>>>> RuntimeWarning: invalid value encountered in true_divide >>>>> theta = np.arccos(z / r) >>>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:364: >>>>> UserWarning: The MAPMRI positivity constraint depends on CVXOPT (http: >>>>> xopt.org/). CVXOPT is licensed under the GPL (see: >>>>> http://cvxopt.org/copyright.html) and you may be subject to this >>>>> license when using positivity constraint. >>>>> warn(w_s) >>>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:389: >>>>> RuntimeWarning: invalid value encountered in divide >>>>> data = np.asarray(data / data[self.gtab.b0s_mask].mean()) >>>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:413: >>>>> UserWarning: Optimization did not find a solution >>>>> warn('Optimization did not find a solution') >>>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:444: >>>>> UserWarning: Optimization did not find a solution >>>>> warn('Optimization did not find a solution') >>>>> Traceback (most recent call last): >>>>> File "", line 1, in >>>>> File "/Library/Python/2.7/site-packages/dipy/reconst/multi_voxel.py", >>>>> line 33, in new_fit >>>>> fit_array[ijk] = single_voxel_fit(self, data[ijk]) >>>>> File "/Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py", >>>>> line 465, in fit >>>>> coef_iso = coef_iso / sum(coef_iso * self.Bm_iso) >>>>> UnboundLocalError: local variable 'coef_iso' referenced before >>>>> assignment >>>>> >>>>> >>>>> Any suggestions? >>>>> >>>>> Thank you. >>>>> >>>>> ping >>>>> >>>>> On Fri, Jan 12, 2018 at 6:24 PM, Rutger Fick >>>>> wrote: >>>>> >>>>>> Hi Ping, >>>>>> >>>>>> Attached is the mapmri code that also has PA, just put it in the >>>>>> dipy/reconst/ folder (where also the current mapmri.py file is) and run >>>>>> "python setup.py install" from dipy's main folder. That should make it >>>>>> usable in the same way as the current mapmri module. >>>>>> Note that its based on an old implementation that still works with >>>>>> the "cvxopt" optimizer package, so you'll have to install cvxopt to make it >>>>>> run. >>>>>> >>>>>> I recommend you use the model with both laplacian regularization and >>>>>> positivity constraint, this give the best results in general. >>>>>> >>>>>> from dipy.reconst import mapmri_pa >>>>>> mapmod = mapmri_pa.MapmriModel(gtab, >>>>>> laplacian_regularization=True, # >>>>>> this regularization enhances reproducibility of estimated q-space indices >>>>>> by imposing smoothness >>>>>> laplacian_weighting="GCV", # this >>>>>> makes it use generalized cross-validation to find the best regularization >>>>>> weight >>>>>> positivity_constraint=True) # this >>>>>> ensures the estimated PDF is positive >>>>>> mapfit = mapmod.fit(data) >>>>>> pa = mapfit.pa() >>>>>> >>>>>> Aside from the original MAPMRI citation for Ozarslan et al. (2013), >>>>>> note that the relevant citation for dipy's laplacian-regularized MAP-MRI >>>>>> implementation is [1]. >>>>>> [1] Fick, Rutger HJ, et al. "MAPL: Tissue microstructure estimation >>>>>> using Laplacian-regularized MAP-MRI and its application to HCP data." >>>>>> *NeuroImage* 134 (2016): 365-385. >>>>>> >>>>>> Hope it helps and let me know if you need anything else, >>>>>> Rutger >>>>>> >>>>>> >>>>>> On 12 January 2018 at 21:48, Ping-Hong Yeh >>>>>> wrote: >>>>>> >>>>>>> Hi Roger, >>>>>>> >>>>>>> Thanks for the prompt reply. >>>>>>> May I have the code for estimating PA? >>>>>>> >>>>>>> Ping >>>>>>> >>>>>>> On Jan 12, 2018 3:21 PM, "Rutger Fick" >>>>>>> wrote: >>>>>>> >>>>>>>> Hi Ping, >>>>>>>> >>>>>>>> MAPL is just a name for using laplacian-regularized MAP-MRI. If >>>>>>>> you're using the dipy mapmri implementation then you're using MAPL by >>>>>>>> default. >>>>>>>> From a fitted mapmri model you can estimate overall non-gaussianity >>>>>>>> using fitted_model.ng(), and parallel and perpendicular non-Gaussianity >>>>>>>> using ng_parallel() and ng_perpendicperpendicularular(). >>>>>>>> Propagator Anisotropic is not included in the current dipy >>>>>>>> implementation. However, I do have a personal version of dipy's mapmri >>>>>>>> implementation that includes it, if you're interested. >>>>>>>> >>>>>>>> Best, >>>>>>>> Rutger >>>>>>>> >>>>>>>> On 12 January 2018 at 16:49, Ping-Hong Yeh >>>>>>>> wrote: >>>>>>>> >>>>>>>>> Hi DIPY users, >>>>>>>>> >>>>>>>>> I would like to know the way of estimating non-Gaussian and PA, >>>>>>>>> mentioned in the Avram et al. ?Clinical feasibility of using mean >>>>>>>>> apparent propagator (MAP) MRI to characterize brain tissue microstructure? >>>>>>>>> paper, using MAPMRI or MAPL model. >>>>>>>>> >>>>>>>>> Thank you. >>>>>>>>> >>>>>>>>> Ping >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Neuroimaging mailing list >>>>>>>>> Neuroimaging at python.org >>>>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Neuroimaging mailing list >>>>>>>> Neuroimaging at python.org >>>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>>> >>>>>>>> >>>>>>> _______________________________________________ >>>>>>> Neuroimaging mailing list >>>>>>> Neuroimaging at python.org >>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>> >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Neuroimaging mailing list >>>>>> Neuroimaging at python.org >>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Neuroimaging mailing list >>>>> Neuroimaging at python.org >>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Neuroimaging mailing list >>>> Neuroimaging at python.org >>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>> >>>> >>> >>> _______________________________________________ >>> Neuroimaging mailing list >>> Neuroimaging at python.org >>> https://mail.python.org/mailman/listinfo/neuroimaging >>> >>> >> _______________________________________________ >> Neuroimaging mailing list >> Neuroimaging at python.org >> https://mail.python.org/mailman/listinfo/neuroimaging >> >> > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Maxime.Descoteaux at USherbrooke.ca Sat Jan 20 13:24:57 2018 From: Maxime.Descoteaux at USherbrooke.ca (Maxime Descoteaux) Date: Sat, 20 Jan 2018 18:24:57 +0000 Subject: [Neuroimaging] New tractography challenge Message-ID: <0836BFCB-0406-4931-9C92-7A1718512F44@usherbrooke.ca> Dear Colleagues, We are pleased to announce that the IEEE International Symposium on Biomedical Engineering (ISBI) has endorsed the 3-D Validation of Tractography with Experimental MRI (3D-VoTEM) challenge. The goal of the proposed 3D-VoTEM challenge is to assess the anatomical accuracy of common and emerging tractography pipelines and algorithms, resulting in novel insights into both the successes and limitations of these techniques. The findings from this competition will be prepared as a high impact manuscript to Sciences Advances. Please see our URL for full challenge details: https://my.vanderbilt.edu/votem/ Additional Challenge Details: Uniquely, this challenge contains 3 separate datasets/challenges. (A) The first sub-challenge is based on a 3D anisotropic diffusion phantom, created by Synaptive Medical, which contains complex geometries and anisotropic microstructure intended to mimic linear, crossing, and kissing/touching fiber bundles. (B) The second-sub challenge features the dataset (provided by the NIH) that has previously been used to provide assessment of both sensitivity and specificity, and anatomical accuracy, of white matter tractography (Thomas et al., PNAS 2014). The dataset is composed of high SNR images of an ex vivo macaque brainat high spatial and angular resolution ? a high quality dataset almost devoid of experimental confounds and artifacts that typically arise in in vivo diffusion studies. By using the framework from the original publication, the challenge presents a way to evaluate the anatomical accuracy of several new several new diffusion reconstruction and tracking approaches have been developed. (C) The third-sub challenge is based on data acquired on the squirrel monkey brain. Both MRI and histological tracer injections were performed on the same specimen, which allows voxel-wise assessment of anatomical accuracy of tractography. In addition, high resolution histology allows spatial analysis of the errors of tractography. Joining the challenge To access the data and participate in the challenge, simply join each of the three challenges following the steps outlined on https://my.vanderbilt.edu/votem/registration-and-data-access/ navigate the user through the Synapse challenge interface. Challenge Timeline Submission site will be open from January 15-March 4. ISBI 2018 is on April 4. Contact email votem-organizers at googlegroups.com Looking forward to your participation. Best Max on behalf of all organizers Maxime Descoteaux, PhD Full Professor Research Chair in NeuroInformatics Sherbrooke Connectivity Imaging Laboratory (SCIL) Computer Science department Sherbrooke University 2500 Boul. Universit? Sherbrooke, Qu?bec J1K 2R1, Canada http://scil.dinf.usherbrooke.ca -------------- next part -------------- An HTML attachment was scrubbed... URL: From pinghongyeh at gmail.com Fri Jan 19 16:03:00 2018 From: pinghongyeh at gmail.com (Ping-Hong Yeh) Date: Fri, 19 Jan 2018 16:03:00 -0500 Subject: [Neuroimaging] [DIPY] propagator anisotropy estimation using MAP(L)MRI In-Reply-To: References: Message-ID: Hi Rutger, Attached please find the snapshot of norm_of_laplacian_signal, lopt, and pa maps of the same data set i used earlier. BTW, is there a way to speed up the mapmri_pa processing? Will the OpenMP help? Thank you, ping On Fri, Jan 19, 2018 at 1:25 PM, Rutger Fick wrote: > Hi Ping, > > So far, so good. > In my opinion the TORTOISE PA reconstruction looks a bit > flat/overregularized - but then again I don't know what kind of > regularization they implemented for themselves. > The PA of the implementation I gave you seems to give more consistent > contrast for different tissue configurations - which is a good - but looks > like it under-regularizes in some individual voxels (the salt-pepper noise > in the PA/RTOP). > > To check if this is the case, can you show me the > mapfit_L.norm_of_laplacian_signal() and mapfit_L.lopt maps? > > Rutger > > > > > On 19 January 2018 at 17:43, Ping-Hong Yeh wrote: > >> Hi Rutger, >> >> Just give you an update of the results (see the attached snapshots) >> using GCV weighted and Laplacian regularization for MAPMRI estimation. >> >> The other PA mapping was calculated using TORTOISE. I have also attached >> RTOP mapping calculated using DIPY with and without GCV weighted and Laplacian >> regularization. >> >> Comparing to the TORTOISE, PA values in the one using GCV weighted and Laplacian >> regularization method are relatively smaller, particularly over the regions >> with the less dense white matter. >> >> For RTOP images, I am not sure whether GCV weighted and Laplacian >> regularization method outperforms the one without using GCV weighted and >> Laplacian regularization. >> >> Any comments? >> Thank you, >> >> ping >> >> On Wed, Jan 17, 2018 at 7:48 PM, Rutger Fick >> wrote: >> >>> Hi Ping, >>> >>> If it's still running and gave only that error then probably it was just >>> a single voxel that failed and the rest is working. However, I recommend >>> you first try to fit a smaller dataset (just a few voxels or a single >>> slice) just to check the results make sense. >>> >>> I should mention that the code I gave you is slower than Dipy's public >>> version for reasons I won't get into, so don't worry if you have to wait >>> longer than before. >>> >>> Best, >>> Rutger >>> >>> On 18 Jan 2018 00:58, "Ping-Hong Yeh" wrote: >>> >>>> Hi Rutger, >>>> >>>> Thanks again for the prompt reply. >>>> >>>> Adding "mask" to mapmri have fixed the error; however, another error >>>> shows up, >>>> >>>> mapfit_L = map_model_L.fit(data,mask=data[..., 0]>0) >>>> dipy/core/geometry.py:129: RuntimeWarning: invalid value encountered in >>>> true_divide >>>> theta = np.arccos(z / r) >>>> dipy/reconst/mapmri_pa.py:364: UserWarning: The MAPMRI positivity >>>> constraint depends on CVXOPT (http://cvxopt.org/). CVXOPT is licensed >>>> under the GPL (see: http://cvxopt.org/copyright.html) and you may be >>>> subject to this license when using the positivity constraint. >>>> warn(w_s) >>>> dipy/reconst/mapmri_pa.py:413: UserWarning: Optimization did not find a >>>> solution >>>> warn('Optimization did not find a solution') >>>> Error: Couldn't find per display information >>>> >>>> >>>> It is still running though. Should i stop the running? >>>> >>>> Thank you. >>>> ping >>>> >>>> On Tue, Jan 16, 2018 at 7:18 PM, Rutger Fick >>>> wrote: >>>> >>>>> Hi Ping, >>>>> >>>>> Reading the error messages, it looks like you're fitting a masked >>>>> voxel. The following error: >>>>> >>>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:389: >>>>> RuntimeWarning: invalid value encountered in divide >>>>> data = np.asarray(data / data[self.gtab.b0s_mask].mean()) >>>>> >>>>> says you're dividing by either zero or NaN, which means your b0 value >>>>> of that voxel was zero (or you had no b0 values possibly). Note that mapmri >>>>> needs at least one b0 measurement. >>>>> I recommend you check if it works when you fit a voxel that you know >>>>> for sure is in white matter. If it works, you can do something like >>>>> map_model_L.fit(data, mask=data[..., 0]>0) to use a mask that only >>>>> fits if the first measured DWI is positive (assuming your first measurement >>>>> is a b0). >>>>> >>>>> Best, >>>>> Rutger >>>>> >>>>> >>>>> >>>>> On 16 January 2018 at 23:46, Ping-Hong Yeh >>>>> wrote: >>>>> >>>>>> Hi Rutger, >>>>>> >>>>>> I got an error running the map_model.fit using mapmri_pa. Here is the >>>>>> scripts i used, >>>>>> >>>>>> >>>>>> map_model_L = mapmri_pa.MapmriModel(gtab, radial_order=radial_order, >>>>>> laplacian_regularization=True, # >>>>>> this regularization enhances reproducibility of estimated q-space indices >>>>>> by imposing smoothness >>>>>> laplacian_weighting="GCV", # this >>>>>> makes it use generalized cross-validation to find the best regularization >>>>>> weight >>>>>> positivity_constraint=True) # this >>>>>> ensures the estimated PDF is positive >>>>>> >>>>>> mapfit_L = map_model_L.fit(data) >>>>>> >>>>>> , and the error message, >>>>>> >>>>>> >>>>>> /Library/Python/2.7/site-packages/dipy/core/geometry.py:129: >>>>>> RuntimeWarning: invalid value encountered in true_divide >>>>>> theta = np.arccos(z / r) >>>>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:364: >>>>>> UserWarning: The MAPMRI positivity constraint depends on CVXOPT (http: >>>>>> xopt.org/). CVXOPT is licensed under the GPL (see: >>>>>> http://cvxopt.org/copyright.html) and you may be subject to this >>>>>> license when using positivity constraint. >>>>>> warn(w_s) >>>>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:389: >>>>>> RuntimeWarning: invalid value encountered in divide >>>>>> data = np.asarray(data / data[self.gtab.b0s_mask].mean()) >>>>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:413: >>>>>> UserWarning: Optimization did not find a solution >>>>>> warn('Optimization did not find a solution') >>>>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:444: >>>>>> UserWarning: Optimization did not find a solution >>>>>> warn('Optimization did not find a solution') >>>>>> Traceback (most recent call last): >>>>>> File "", line 1, in >>>>>> File "/Library/Python/2.7/site-packages/dipy/reconst/multi_voxel.py", >>>>>> line 33, in new_fit >>>>>> fit_array[ijk] = single_voxel_fit(self, data[ijk]) >>>>>> File "/Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py", >>>>>> line 465, in fit >>>>>> coef_iso = coef_iso / sum(coef_iso * self.Bm_iso) >>>>>> UnboundLocalError: local variable 'coef_iso' referenced before >>>>>> assignment >>>>>> >>>>>> >>>>>> Any suggestions? >>>>>> >>>>>> Thank you. >>>>>> >>>>>> ping >>>>>> >>>>>> On Fri, Jan 12, 2018 at 6:24 PM, Rutger Fick >>>>>> wrote: >>>>>> >>>>>>> Hi Ping, >>>>>>> >>>>>>> Attached is the mapmri code that also has PA, just put it in the >>>>>>> dipy/reconst/ folder (where also the current mapmri.py file is) and run >>>>>>> "python setup.py install" from dipy's main folder. That should make it >>>>>>> usable in the same way as the current mapmri module. >>>>>>> Note that its based on an old implementation that still works with >>>>>>> the "cvxopt" optimizer package, so you'll have to install cvxopt to make it >>>>>>> run. >>>>>>> >>>>>>> I recommend you use the model with both laplacian regularization and >>>>>>> positivity constraint, this give the best results in general. >>>>>>> >>>>>>> from dipy.reconst import mapmri_pa >>>>>>> mapmod = mapmri_pa.MapmriModel(gtab, >>>>>>> laplacian_regularization=True, # >>>>>>> this regularization enhances reproducibility of estimated q-space indices >>>>>>> by imposing smoothness >>>>>>> laplacian_weighting="GCV", # this >>>>>>> makes it use generalized cross-validation to find the best regularization >>>>>>> weight >>>>>>> positivity_constraint=True) # this >>>>>>> ensures the estimated PDF is positive >>>>>>> mapfit = mapmod.fit(data) >>>>>>> pa = mapfit.pa() >>>>>>> >>>>>>> Aside from the original MAPMRI citation for Ozarslan et al. (2013), >>>>>>> note that the relevant citation for dipy's laplacian-regularized MAP-MRI >>>>>>> implementation is [1]. >>>>>>> [1] Fick, Rutger HJ, et al. "MAPL: Tissue microstructure estimation >>>>>>> using Laplacian-regularized MAP-MRI and its application to HCP data." >>>>>>> *NeuroImage* 134 (2016): 365-385. >>>>>>> >>>>>>> Hope it helps and let me know if you need anything else, >>>>>>> Rutger >>>>>>> >>>>>>> >>>>>>> On 12 January 2018 at 21:48, Ping-Hong Yeh >>>>>>> wrote: >>>>>>> >>>>>>>> Hi Roger, >>>>>>>> >>>>>>>> Thanks for the prompt reply. >>>>>>>> May I have the code for estimating PA? >>>>>>>> >>>>>>>> Ping >>>>>>>> >>>>>>>> On Jan 12, 2018 3:21 PM, "Rutger Fick" >>>>>>>> wrote: >>>>>>>> >>>>>>>>> Hi Ping, >>>>>>>>> >>>>>>>>> MAPL is just a name for using laplacian-regularized MAP-MRI. If >>>>>>>>> you're using the dipy mapmri implementation then you're using MAPL by >>>>>>>>> default. >>>>>>>>> From a fitted mapmri model you can estimate overall >>>>>>>>> non-gaussianity using fitted_model.ng(), and parallel and perpendicular >>>>>>>>> non-Gaussianity using ng_parallel() and ng_perpendicperpendicular >>>>>>>>> ular(). >>>>>>>>> Propagator Anisotropic is not included in the current dipy >>>>>>>>> implementation. However, I do have a personal version of dipy's mapmri >>>>>>>>> implementation that includes it, if you're interested. >>>>>>>>> >>>>>>>>> Best, >>>>>>>>> Rutger >>>>>>>>> >>>>>>>>> On 12 January 2018 at 16:49, Ping-Hong Yeh >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> Hi DIPY users, >>>>>>>>>> >>>>>>>>>> I would like to know the way of estimating non-Gaussian and PA, >>>>>>>>>> mentioned in the Avram et al. ?Clinical feasibility of using >>>>>>>>>> mean apparent propagator (MAP) MRI to characterize brain tissue >>>>>>>>>> microstructure? paper, using MAPMRI or MAPL model. >>>>>>>>>> >>>>>>>>>> Thank you. >>>>>>>>>> >>>>>>>>>> Ping >>>>>>>>>> >>>>>>>>>> _______________________________________________ >>>>>>>>>> Neuroimaging mailing list >>>>>>>>>> Neuroimaging at python.org >>>>>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Neuroimaging mailing list >>>>>>>>> Neuroimaging at python.org >>>>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>>>> >>>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Neuroimaging mailing list >>>>>>>> Neuroimaging at python.org >>>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Neuroimaging mailing list >>>>>>> Neuroimaging at python.org >>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>> >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Neuroimaging mailing list >>>>>> Neuroimaging at python.org >>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Neuroimaging mailing list >>>>> Neuroimaging at python.org >>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Neuroimaging mailing list >>>> Neuroimaging at python.org >>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>> >>>> >>> _______________________________________________ >>> Neuroimaging mailing list >>> Neuroimaging at python.org >>> https://mail.python.org/mailman/listinfo/neuroimaging >>> >>> >> >> _______________________________________________ >> Neuroimaging mailing list >> Neuroimaging at python.org >> https://mail.python.org/mailman/listinfo/neuroimaging >> >> > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pa_dipy.png Type: image/png Size: 126670 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: normof_laplacisnsignal_dipy.png Type: image/png Size: 111855 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: lopt_dipy.png Type: image/png Size: 126169 bytes Desc: not available URL: From elef at indiana.edu Mon Jan 22 17:59:38 2018 From: elef at indiana.edu (Eleftherios Garyfallidis) Date: Mon, 22 Jan 2018 22:59:38 +0000 Subject: [Neuroimaging] GSoC 2018 - DIPY In-Reply-To: References: Message-ID: Hello DIPY developers, Please see revised wiki page https://github.com/nipy/dipy/wiki/Google-Summer-of-Code-2018 And let me know if you want to mentor or suggest new projects. Best, Eleftherios On Thu, Jan 11, 2018 at 11:52 AM Eleftherios Garyfallidis wrote: > Hello DIPY developers, > > We are planning to participate in GSoC this year. > We have started a wiki page. > https://github.com/nipy/dipy/wiki/Google-Summer-of-Code-2018 > > Send me an email if you want to be a mentor and be happy to suggest or > lead new projects for this year. > > Best regards, > Eleftherios > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fick.rutger at gmail.com Mon Jan 22 18:55:27 2018 From: fick.rutger at gmail.com (Rutger Fick) Date: Tue, 23 Jan 2018 00:55:27 +0100 Subject: [Neuroimaging] [DIPY] propagator anisotropy estimation using MAP(L)MRI In-Reply-To: References: Message-ID: Hi Ping, In my experience, badly estimated voxels typically have super high laplacian norm and very low estimated laplacian weight (lopt). Looking at these results I would say things actually look pretty good! Getting the best results is always tricky finding a balance of optimally regularizing: not fitting the noise but also not over-regularizing, which is why the GCV option is nice. But, in rare cases it does mess up. So, if you want to give the GCV a bit less freedom to go low (to be on the safe side) you can increase the minimum bound of the GCV optimization in line 2272 of the code. There's many ways to speed up the code I gave you if you want to put in the effort ;-) Using parallel processing is not standardly implemented in dipy, but maybe you can hack it somehow. You can also set the laplacian_weight = 0.1 or something to avoid GCV, but it won't make a huge difference. I only ever used this code to do research - so speed was not really a concern. Anyway, hope this all helped! Let me know if everything works out, Best, Rutger On 19 January 2018 at 22:03, Ping-Hong Yeh wrote: > Hi Rutger, > > Attached please find the snapshot of norm_of_laplacian_signal, lopt, and > pa maps of the same data set i used earlier. > > BTW, is there a way to speed up the mapmri_pa processing? Will the OpenMP > help? > > Thank you, > > ping > > On Fri, Jan 19, 2018 at 1:25 PM, Rutger Fick > wrote: > >> Hi Ping, >> >> So far, so good. >> In my opinion the TORTOISE PA reconstruction looks a bit >> flat/overregularized - but then again I don't know what kind of >> regularization they implemented for themselves. >> The PA of the implementation I gave you seems to give more consistent >> contrast for different tissue configurations - which is a good - but looks >> like it under-regularizes in some individual voxels (the salt-pepper noise >> in the PA/RTOP). >> >> To check if this is the case, can you show me the >> mapfit_L.norm_of_laplacian_signal() and mapfit_L.lopt maps? >> >> Rutger >> >> >> >> >> On 19 January 2018 at 17:43, Ping-Hong Yeh wrote: >> >>> Hi Rutger, >>> >>> Just give you an update of the results (see the attached snapshots) >>> using GCV weighted and Laplacian regularization for MAPMRI estimation. >>> >>> The other PA mapping was calculated using TORTOISE. I have also >>> attached RTOP mapping calculated using DIPY with and without GCV >>> weighted and Laplacian regularization. >>> >>> Comparing to the TORTOISE, PA values in the one using GCV weighted and Laplacian >>> regularization method are relatively smaller, particularly over the regions >>> with the less dense white matter. >>> >>> For RTOP images, I am not sure whether GCV weighted and Laplacian >>> regularization method outperforms the one without using GCV weighted >>> and Laplacian regularization. >>> >>> Any comments? >>> Thank you, >>> >>> ping >>> >>> On Wed, Jan 17, 2018 at 7:48 PM, Rutger Fick >>> wrote: >>> >>>> Hi Ping, >>>> >>>> If it's still running and gave only that error then probably it was >>>> just a single voxel that failed and the rest is working. However, I >>>> recommend you first try to fit a smaller dataset (just a few voxels or a >>>> single slice) just to check the results make sense. >>>> >>>> I should mention that the code I gave you is slower than Dipy's public >>>> version for reasons I won't get into, so don't worry if you have to wait >>>> longer than before. >>>> >>>> Best, >>>> Rutger >>>> >>>> On 18 Jan 2018 00:58, "Ping-Hong Yeh" wrote: >>>> >>>>> Hi Rutger, >>>>> >>>>> Thanks again for the prompt reply. >>>>> >>>>> Adding "mask" to mapmri have fixed the error; however, another error >>>>> shows up, >>>>> >>>>> mapfit_L = map_model_L.fit(data,mask=data[..., 0]>0) >>>>> dipy/core/geometry.py:129: RuntimeWarning: invalid value encountered >>>>> in true_divide >>>>> theta = np.arccos(z / r) >>>>> dipy/reconst/mapmri_pa.py:364: UserWarning: The MAPMRI positivity >>>>> constraint depends on CVXOPT (http://cvxopt.org/). CVXOPT is licensed >>>>> under the GPL (see: http://cvxopt.org/copyright.html) and you may be >>>>> subject to this license when using the positivity constraint. >>>>> warn(w_s) >>>>> dipy/reconst/mapmri_pa.py:413: UserWarning: Optimization did not find >>>>> a solution >>>>> warn('Optimization did not find a solution') >>>>> Error: Couldn't find per display information >>>>> >>>>> >>>>> It is still running though. Should i stop the running? >>>>> >>>>> Thank you. >>>>> ping >>>>> >>>>> On Tue, Jan 16, 2018 at 7:18 PM, Rutger Fick >>>>> wrote: >>>>> >>>>>> Hi Ping, >>>>>> >>>>>> Reading the error messages, it looks like you're fitting a masked >>>>>> voxel. The following error: >>>>>> >>>>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:389: >>>>>> RuntimeWarning: invalid value encountered in divide >>>>>> data = np.asarray(data / data[self.gtab.b0s_mask].mean()) >>>>>> >>>>>> says you're dividing by either zero or NaN, which means your b0 value >>>>>> of that voxel was zero (or you had no b0 values possibly). Note that mapmri >>>>>> needs at least one b0 measurement. >>>>>> I recommend you check if it works when you fit a voxel that you know >>>>>> for sure is in white matter. If it works, you can do something like >>>>>> map_model_L.fit(data, mask=data[..., 0]>0) to use a mask that only >>>>>> fits if the first measured DWI is positive (assuming your first measurement >>>>>> is a b0). >>>>>> >>>>>> Best, >>>>>> Rutger >>>>>> >>>>>> >>>>>> >>>>>> On 16 January 2018 at 23:46, Ping-Hong Yeh >>>>>> wrote: >>>>>> >>>>>>> Hi Rutger, >>>>>>> >>>>>>> I got an error running the map_model.fit using mapmri_pa. Here is >>>>>>> the scripts i used, >>>>>>> >>>>>>> >>>>>>> map_model_L = mapmri_pa.MapmriModel(gtab, radial_order=radial_order, >>>>>>> laplacian_regularization=True, # >>>>>>> this regularization enhances reproducibility of estimated q-space indices >>>>>>> by imposing smoothness >>>>>>> laplacian_weighting="GCV", # this >>>>>>> makes it use generalized cross-validation to find the best regularization >>>>>>> weight >>>>>>> positivity_constraint=True) # this >>>>>>> ensures the estimated PDF is positive >>>>>>> >>>>>>> mapfit_L = map_model_L.fit(data) >>>>>>> >>>>>>> , and the error message, >>>>>>> >>>>>>> >>>>>>> /Library/Python/2.7/site-packages/dipy/core/geometry.py:129: >>>>>>> RuntimeWarning: invalid value encountered in true_divide >>>>>>> theta = np.arccos(z / r) >>>>>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:364: >>>>>>> UserWarning: The MAPMRI positivity constraint depends on CVXOPT (http: >>>>>>> xopt.org/). CVXOPT is licensed under the GPL (see: >>>>>>> http://cvxopt.org/copyright.html) and you may be subject to this >>>>>>> license when using positivity constraint. >>>>>>> warn(w_s) >>>>>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:389: >>>>>>> RuntimeWarning: invalid value encountered in divide >>>>>>> data = np.asarray(data / data[self.gtab.b0s_mask].mean()) >>>>>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:413: >>>>>>> UserWarning: Optimization did not find a solution >>>>>>> warn('Optimization did not find a solution') >>>>>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:444: >>>>>>> UserWarning: Optimization did not find a solution >>>>>>> warn('Optimization did not find a solution') >>>>>>> Traceback (most recent call last): >>>>>>> File "", line 1, in >>>>>>> File "/Library/Python/2.7/site-packages/dipy/reconst/multi_voxel.py", >>>>>>> line 33, in new_fit >>>>>>> fit_array[ijk] = single_voxel_fit(self, data[ijk]) >>>>>>> File "/Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py", >>>>>>> line 465, in fit >>>>>>> coef_iso = coef_iso / sum(coef_iso * self.Bm_iso) >>>>>>> UnboundLocalError: local variable 'coef_iso' referenced before >>>>>>> assignment >>>>>>> >>>>>>> >>>>>>> Any suggestions? >>>>>>> >>>>>>> Thank you. >>>>>>> >>>>>>> ping >>>>>>> >>>>>>> On Fri, Jan 12, 2018 at 6:24 PM, Rutger Fick >>>>>>> wrote: >>>>>>> >>>>>>>> Hi Ping, >>>>>>>> >>>>>>>> Attached is the mapmri code that also has PA, just put it in the >>>>>>>> dipy/reconst/ folder (where also the current mapmri.py file is) and run >>>>>>>> "python setup.py install" from dipy's main folder. That should make it >>>>>>>> usable in the same way as the current mapmri module. >>>>>>>> Note that its based on an old implementation that still works with >>>>>>>> the "cvxopt" optimizer package, so you'll have to install cvxopt to make it >>>>>>>> run. >>>>>>>> >>>>>>>> I recommend you use the model with both laplacian regularization >>>>>>>> and positivity constraint, this give the best results in general. >>>>>>>> >>>>>>>> from dipy.reconst import mapmri_pa >>>>>>>> mapmod = mapmri_pa.MapmriModel(gtab, >>>>>>>> laplacian_regularization=True, # >>>>>>>> this regularization enhances reproducibility of estimated q-space indices >>>>>>>> by imposing smoothness >>>>>>>> laplacian_weighting="GCV", # this >>>>>>>> makes it use generalized cross-validation to find the best regularization >>>>>>>> weight >>>>>>>> positivity_constraint=True) # this >>>>>>>> ensures the estimated PDF is positive >>>>>>>> mapfit = mapmod.fit(data) >>>>>>>> pa = mapfit.pa() >>>>>>>> >>>>>>>> Aside from the original MAPMRI citation for Ozarslan et al. (2013), >>>>>>>> note that the relevant citation for dipy's laplacian-regularized MAP-MRI >>>>>>>> implementation is [1]. >>>>>>>> [1] Fick, Rutger HJ, et al. "MAPL: Tissue microstructure estimation >>>>>>>> using Laplacian-regularized MAP-MRI and its application to HCP data." >>>>>>>> *NeuroImage* 134 (2016): 365-385. >>>>>>>> >>>>>>>> Hope it helps and let me know if you need anything else, >>>>>>>> Rutger >>>>>>>> >>>>>>>> >>>>>>>> On 12 January 2018 at 21:48, Ping-Hong Yeh >>>>>>>> wrote: >>>>>>>> >>>>>>>>> Hi Roger, >>>>>>>>> >>>>>>>>> Thanks for the prompt reply. >>>>>>>>> May I have the code for estimating PA? >>>>>>>>> >>>>>>>>> Ping >>>>>>>>> >>>>>>>>> On Jan 12, 2018 3:21 PM, "Rutger Fick" >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> Hi Ping, >>>>>>>>>> >>>>>>>>>> MAPL is just a name for using laplacian-regularized MAP-MRI. If >>>>>>>>>> you're using the dipy mapmri implementation then you're using MAPL by >>>>>>>>>> default. >>>>>>>>>> From a fitted mapmri model you can estimate overall >>>>>>>>>> non-gaussianity using fitted_model.ng(), and parallel and perpendicular >>>>>>>>>> non-Gaussianity using ng_parallel() and ng_perpendicperpendicular >>>>>>>>>> ular(). >>>>>>>>>> Propagator Anisotropic is not included in the current dipy >>>>>>>>>> implementation. However, I do have a personal version of dipy's mapmri >>>>>>>>>> implementation that includes it, if you're interested. >>>>>>>>>> >>>>>>>>>> Best, >>>>>>>>>> Rutger >>>>>>>>>> >>>>>>>>>> On 12 January 2018 at 16:49, Ping-Hong Yeh >>>>>>>>> > wrote: >>>>>>>>>> >>>>>>>>>>> Hi DIPY users, >>>>>>>>>>> >>>>>>>>>>> I would like to know the way of estimating non-Gaussian and PA, >>>>>>>>>>> mentioned in the Avram et al. ?Clinical feasibility of using >>>>>>>>>>> mean apparent propagator (MAP) MRI to characterize brain tissue >>>>>>>>>>> microstructure? paper, using MAPMRI or MAPL model. >>>>>>>>>>> >>>>>>>>>>> Thank you. >>>>>>>>>>> >>>>>>>>>>> Ping >>>>>>>>>>> >>>>>>>>>>> _______________________________________________ >>>>>>>>>>> Neuroimaging mailing list >>>>>>>>>>> Neuroimaging at python.org >>>>>>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> _______________________________________________ >>>>>>>>>> Neuroimaging mailing list >>>>>>>>>> Neuroimaging at python.org >>>>>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>>>>> >>>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Neuroimaging mailing list >>>>>>>>> Neuroimaging at python.org >>>>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Neuroimaging mailing list >>>>>>>> Neuroimaging at python.org >>>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Neuroimaging mailing list >>>>>>> Neuroimaging at python.org >>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>> >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Neuroimaging mailing list >>>>>> Neuroimaging at python.org >>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Neuroimaging mailing list >>>>> Neuroimaging at python.org >>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>> >>>>> >>>> _______________________________________________ >>>> Neuroimaging mailing list >>>> Neuroimaging at python.org >>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>> >>>> >>> >>> _______________________________________________ >>> Neuroimaging mailing list >>> Neuroimaging at python.org >>> https://mail.python.org/mailman/listinfo/neuroimaging >>> >>> >> >> _______________________________________________ >> Neuroimaging mailing list >> Neuroimaging at python.org >> https://mail.python.org/mailman/listinfo/neuroimaging >> >> > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pinghongyeh at gmail.com Mon Jan 22 21:06:26 2018 From: pinghongyeh at gmail.com (Ping-Hong Yeh) Date: Mon, 22 Jan 2018 21:06:26 -0500 Subject: [Neuroimaging] [DIPY] propagator anisotropy estimation using MAP(L)MRI In-Reply-To: References: Message-ID: Hi Rutger, Thank you very much for the detailed reply. I guess i do not need to worry about those salt-pepper dots? Would you recommend output laplacian norm and laplacian_weighted maps and go through the images for each data set? Any tips for realizing something really goes wrong when looking at the propagator anisotropy map? Best, Ping On Jan 22, 2018 6:55 PM, "Rutger Fick" wrote: > Hi Ping, > > In my experience, badly estimated voxels typically have super high > laplacian norm and very low estimated laplacian weight (lopt). > Looking at these results I would say things actually look pretty good! > > Getting the best results is always tricky finding a balance of optimally > regularizing: not fitting the noise but also not over-regularizing, which > is why the GCV option is nice. > But, in rare cases it does mess up. So, if you want to give the GCV a bit > less freedom to go low (to be on the safe side) you can increase the > minimum bound of the GCV optimization in line 2272 of the code. > > There's many ways to speed up the code I gave you if you want to put in > the effort ;-) Using parallel processing is not standardly implemented in > dipy, but maybe you can hack it somehow. > You can also set the laplacian_weight = 0.1 or something to avoid GCV, but > it won't make a huge difference. I only ever used this code to do research > - so speed was not really a concern. > > Anyway, hope this all helped! Let me know if everything works out, > > Best, > Rutger > > On 19 January 2018 at 22:03, Ping-Hong Yeh wrote: > >> Hi Rutger, >> >> Attached please find the snapshot of norm_of_laplacian_signal, lopt, >> and pa maps of the same data set i used earlier. >> >> BTW, is there a way to speed up the mapmri_pa processing? Will the OpenMP >> help? >> >> Thank you, >> >> ping >> >> On Fri, Jan 19, 2018 at 1:25 PM, Rutger Fick >> wrote: >> >>> Hi Ping, >>> >>> So far, so good. >>> In my opinion the TORTOISE PA reconstruction looks a bit >>> flat/overregularized - but then again I don't know what kind of >>> regularization they implemented for themselves. >>> The PA of the implementation I gave you seems to give more consistent >>> contrast for different tissue configurations - which is a good - but looks >>> like it under-regularizes in some individual voxels (the salt-pepper noise >>> in the PA/RTOP). >>> >>> To check if this is the case, can you show me the >>> mapfit_L.norm_of_laplacian_signal() and mapfit_L.lopt maps? >>> >>> Rutger >>> >>> >>> >>> >>> On 19 January 2018 at 17:43, Ping-Hong Yeh >>> wrote: >>> >>>> Hi Rutger, >>>> >>>> Just give you an update of the results (see the attached snapshots) >>>> using GCV weighted and Laplacian regularization for MAPMRI estimation. >>>> >>>> The other PA mapping was calculated using TORTOISE. I have also >>>> attached RTOP mapping calculated using DIPY with and without GCV >>>> weighted and Laplacian regularization. >>>> >>>> Comparing to the TORTOISE, PA values in the one using GCV weighted and >>>> Laplacian regularization method are relatively smaller, particularly >>>> over the regions with the less dense white matter. >>>> >>>> For RTOP images, I am not sure whether GCV weighted and Laplacian >>>> regularization method outperforms the one without using GCV weighted >>>> and Laplacian regularization. >>>> >>>> Any comments? >>>> Thank you, >>>> >>>> ping >>>> >>>> On Wed, Jan 17, 2018 at 7:48 PM, Rutger Fick >>>> wrote: >>>> >>>>> Hi Ping, >>>>> >>>>> If it's still running and gave only that error then probably it was >>>>> just a single voxel that failed and the rest is working. However, I >>>>> recommend you first try to fit a smaller dataset (just a few voxels or a >>>>> single slice) just to check the results make sense. >>>>> >>>>> I should mention that the code I gave you is slower than Dipy's public >>>>> version for reasons I won't get into, so don't worry if you have to wait >>>>> longer than before. >>>>> >>>>> Best, >>>>> Rutger >>>>> >>>>> On 18 Jan 2018 00:58, "Ping-Hong Yeh" wrote: >>>>> >>>>>> Hi Rutger, >>>>>> >>>>>> Thanks again for the prompt reply. >>>>>> >>>>>> Adding "mask" to mapmri have fixed the error; however, another error >>>>>> shows up, >>>>>> >>>>>> mapfit_L = map_model_L.fit(data,mask=data[..., 0]>0) >>>>>> dipy/core/geometry.py:129: RuntimeWarning: invalid value encountered >>>>>> in true_divide >>>>>> theta = np.arccos(z / r) >>>>>> dipy/reconst/mapmri_pa.py:364: UserWarning: The MAPMRI positivity >>>>>> constraint depends on CVXOPT (http://cvxopt.org/). CVXOPT is >>>>>> licensed under the GPL (see: http://cvxopt.org/copyright.html) and >>>>>> you may be subject to this license when using the positivity constraint. >>>>>> warn(w_s) >>>>>> dipy/reconst/mapmri_pa.py:413: UserWarning: Optimization did not find >>>>>> a solution >>>>>> warn('Optimization did not find a solution') >>>>>> Error: Couldn't find per display information >>>>>> >>>>>> >>>>>> It is still running though. Should i stop the running? >>>>>> >>>>>> Thank you. >>>>>> ping >>>>>> >>>>>> On Tue, Jan 16, 2018 at 7:18 PM, Rutger Fick >>>>>> wrote: >>>>>> >>>>>>> Hi Ping, >>>>>>> >>>>>>> Reading the error messages, it looks like you're fitting a masked >>>>>>> voxel. The following error: >>>>>>> >>>>>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:389: >>>>>>> RuntimeWarning: invalid value encountered in divide >>>>>>> data = np.asarray(data / data[self.gtab.b0s_mask].mean()) >>>>>>> >>>>>>> says you're dividing by either zero or NaN, which means your b0 >>>>>>> value of that voxel was zero (or you had no b0 values possibly). Note that >>>>>>> mapmri needs at least one b0 measurement. >>>>>>> I recommend you check if it works when you fit a voxel that you know >>>>>>> for sure is in white matter. If it works, you can do something like >>>>>>> map_model_L.fit(data, mask=data[..., 0]>0) to use a mask that only >>>>>>> fits if the first measured DWI is positive (assuming your first measurement >>>>>>> is a b0). >>>>>>> >>>>>>> Best, >>>>>>> Rutger >>>>>>> >>>>>>> >>>>>>> >>>>>>> On 16 January 2018 at 23:46, Ping-Hong Yeh >>>>>>> wrote: >>>>>>> >>>>>>>> Hi Rutger, >>>>>>>> >>>>>>>> I got an error running the map_model.fit using mapmri_pa. Here is >>>>>>>> the scripts i used, >>>>>>>> >>>>>>>> >>>>>>>> map_model_L = mapmri_pa.MapmriModel(gtab, radial_order=radial_order, >>>>>>>> laplacian_regularization=True, # >>>>>>>> this regularization enhances reproducibility of estimated q-space indices >>>>>>>> by imposing smoothness >>>>>>>> laplacian_weighting="GCV", # this >>>>>>>> makes it use generalized cross-validation to find the best regularization >>>>>>>> weight >>>>>>>> positivity_constraint=True) # this >>>>>>>> ensures the estimated PDF is positive >>>>>>>> >>>>>>>> mapfit_L = map_model_L.fit(data) >>>>>>>> >>>>>>>> , and the error message, >>>>>>>> >>>>>>>> >>>>>>>> /Library/Python/2.7/site-packages/dipy/core/geometry.py:129: >>>>>>>> RuntimeWarning: invalid value encountered in true_divide >>>>>>>> theta = np.arccos(z / r) >>>>>>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:364: >>>>>>>> UserWarning: The MAPMRI positivity constraint depends on CVXOPT (http: >>>>>>>> xopt.org/). CVXOPT is licensed under the GPL (see: >>>>>>>> http://cvxopt.org/copyright.html) and you may be subject to this >>>>>>>> license when using positivity constraint. >>>>>>>> warn(w_s) >>>>>>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:389: >>>>>>>> RuntimeWarning: invalid value encountered in divide >>>>>>>> data = np.asarray(data / data[self.gtab.b0s_mask].mean()) >>>>>>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:413: >>>>>>>> UserWarning: Optimization did not find a solution >>>>>>>> warn('Optimization did not find a solution') >>>>>>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:444: >>>>>>>> UserWarning: Optimization did not find a solution >>>>>>>> warn('Optimization did not find a solution') >>>>>>>> Traceback (most recent call last): >>>>>>>> File "", line 1, in >>>>>>>> File "/Library/Python/2.7/site-packages/dipy/reconst/multi_voxel.py", >>>>>>>> line 33, in new_fit >>>>>>>> fit_array[ijk] = single_voxel_fit(self, data[ijk]) >>>>>>>> File "/Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py", >>>>>>>> line 465, in fit >>>>>>>> coef_iso = coef_iso / sum(coef_iso * self.Bm_iso) >>>>>>>> UnboundLocalError: local variable 'coef_iso' referenced before >>>>>>>> assignment >>>>>>>> >>>>>>>> >>>>>>>> Any suggestions? >>>>>>>> >>>>>>>> Thank you. >>>>>>>> >>>>>>>> ping >>>>>>>> >>>>>>>> On Fri, Jan 12, 2018 at 6:24 PM, Rutger Fick >>>>>>> > wrote: >>>>>>>> >>>>>>>>> Hi Ping, >>>>>>>>> >>>>>>>>> Attached is the mapmri code that also has PA, just put it in the >>>>>>>>> dipy/reconst/ folder (where also the current mapmri.py file is) and run >>>>>>>>> "python setup.py install" from dipy's main folder. That should make it >>>>>>>>> usable in the same way as the current mapmri module. >>>>>>>>> Note that its based on an old implementation that still works with >>>>>>>>> the "cvxopt" optimizer package, so you'll have to install cvxopt to make it >>>>>>>>> run. >>>>>>>>> >>>>>>>>> I recommend you use the model with both laplacian regularization >>>>>>>>> and positivity constraint, this give the best results in general. >>>>>>>>> >>>>>>>>> from dipy.reconst import mapmri_pa >>>>>>>>> mapmod = mapmri_pa.MapmriModel(gtab, >>>>>>>>> laplacian_regularization=True, # >>>>>>>>> this regularization enhances reproducibility of estimated q-space indices >>>>>>>>> by imposing smoothness >>>>>>>>> laplacian_weighting="GCV", # this >>>>>>>>> makes it use generalized cross-validation to find the best regularization >>>>>>>>> weight >>>>>>>>> positivity_constraint=True) # this >>>>>>>>> ensures the estimated PDF is positive >>>>>>>>> mapfit = mapmod.fit(data) >>>>>>>>> pa = mapfit.pa() >>>>>>>>> >>>>>>>>> Aside from the original MAPMRI citation for Ozarslan et al. >>>>>>>>> (2013), note that the relevant citation for dipy's laplacian-regularized >>>>>>>>> MAP-MRI implementation is [1]. >>>>>>>>> [1] Fick, Rutger HJ, et al. "MAPL: Tissue microstructure >>>>>>>>> estimation using Laplacian-regularized MAP-MRI and its application to HCP >>>>>>>>> data." *NeuroImage* 134 (2016): 365-385. >>>>>>>>> >>>>>>>>> Hope it helps and let me know if you need anything else, >>>>>>>>> Rutger >>>>>>>>> >>>>>>>>> >>>>>>>>> On 12 January 2018 at 21:48, Ping-Hong Yeh >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> Hi Roger, >>>>>>>>>> >>>>>>>>>> Thanks for the prompt reply. >>>>>>>>>> May I have the code for estimating PA? >>>>>>>>>> >>>>>>>>>> Ping >>>>>>>>>> >>>>>>>>>> On Jan 12, 2018 3:21 PM, "Rutger Fick" >>>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>>> Hi Ping, >>>>>>>>>>> >>>>>>>>>>> MAPL is just a name for using laplacian-regularized MAP-MRI. If >>>>>>>>>>> you're using the dipy mapmri implementation then you're using MAPL by >>>>>>>>>>> default. >>>>>>>>>>> From a fitted mapmri model you can estimate overall >>>>>>>>>>> non-gaussianity using fitted_model.ng(), and parallel and perpendicular >>>>>>>>>>> non-Gaussianity using ng_parallel() and ng_perpendic >>>>>>>>>>> perpendicularular(). >>>>>>>>>>> Propagator Anisotropic is not included in the current dipy >>>>>>>>>>> implementation. However, I do have a personal version of dipy's mapmri >>>>>>>>>>> implementation that includes it, if you're interested. >>>>>>>>>>> >>>>>>>>>>> Best, >>>>>>>>>>> Rutger >>>>>>>>>>> >>>>>>>>>>> On 12 January 2018 at 16:49, Ping-Hong Yeh < >>>>>>>>>>> pinghongyeh at gmail.com> wrote: >>>>>>>>>>> >>>>>>>>>>>> Hi DIPY users, >>>>>>>>>>>> >>>>>>>>>>>> I would like to know the way of estimating non-Gaussian and >>>>>>>>>>>> PA, mentioned in the Avram et al. ?Clinical feasibility of >>>>>>>>>>>> using mean apparent propagator (MAP) MRI to characterize brain tissue >>>>>>>>>>>> microstructure? paper, using MAPMRI or MAPL model. >>>>>>>>>>>> >>>>>>>>>>>> Thank you. >>>>>>>>>>>> >>>>>>>>>>>> Ping >>>>>>>>>>>> >>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>> Neuroimaging mailing list >>>>>>>>>>>> Neuroimaging at python.org >>>>>>>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> _______________________________________________ >>>>>>>>>>> Neuroimaging mailing list >>>>>>>>>>> Neuroimaging at python.org >>>>>>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> _______________________________________________ >>>>>>>>>> Neuroimaging mailing list >>>>>>>>>> Neuroimaging at python.org >>>>>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Neuroimaging mailing list >>>>>>>>> Neuroimaging at python.org >>>>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Neuroimaging mailing list >>>>>>>> Neuroimaging at python.org >>>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Neuroimaging mailing list >>>>>>> Neuroimaging at python.org >>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>> >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Neuroimaging mailing list >>>>>> Neuroimaging at python.org >>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>> >>>>>> >>>>> _______________________________________________ >>>>> Neuroimaging mailing list >>>>> Neuroimaging at python.org >>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Neuroimaging mailing list >>>> Neuroimaging at python.org >>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>> >>>> >>> >>> _______________________________________________ >>> Neuroimaging mailing list >>> Neuroimaging at python.org >>> https://mail.python.org/mailman/listinfo/neuroimaging >>> >>> >> >> _______________________________________________ >> Neuroimaging mailing list >> Neuroimaging at python.org >> https://mail.python.org/mailman/listinfo/neuroimaging >> >> > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From silva.luisfelipe13 at gmail.com Tue Jan 23 05:04:37 2018 From: silva.luisfelipe13 at gmail.com (=?UTF-8?Q?Lu=C3=ADs_Felipe_da_Silva?=) Date: Tue, 23 Jan 2018 08:04:37 -0200 Subject: [Neuroimaging] GSoC 2018 - DIPY In-Reply-To: References: Message-ID: Hello, I want to be a mentor and be happy to suggest or lead new projects for this year. Thanks, Luis Felipe Moura da Silva On Jan 11, 2018 2:54 PM, "Eleftherios Garyfallidis" wrote: > Hello DIPY developers, > > We are planning to participate in GSoC this year. > We have started a wiki page. > https://github.com/nipy/dipy/wiki/Google-Summer-of-Code-2018 > > Send me an email if you want to be a mentor and be happy to suggest or > lead new projects for this year. > > Best regards, > Eleftherios > > > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fick.rutger at gmail.com Tue Jan 23 07:42:53 2018 From: fick.rutger at gmail.com (Rutger Fick) Date: Tue, 23 Jan 2018 13:42:53 +0100 Subject: [Neuroimaging] [DIPY] propagator anisotropy estimation using MAP(L)MRI In-Reply-To: References: Message-ID: Hi Ping, Salt and pepper noise is not a good sign (I just didn't see it so much on the second set of slices you sent). To spot badly estimated voxels is typically pretty easy - RTOP and many others can have negative or huge values, which typically come from oscillations in the signs extrapolation. You can often see these as bright spots in the laplacian norm. If you go through the data and see that salt and pepper noise corresponds to unusually high norms, Increasing the laplacian minimum weight in the code as i told you wil usually resolve it (or fixing it to a value like 0.05 or 0.1 or something, see what works without overdoing it). Best, Rutger On 23 Jan 2018 03:06, "Ping-Hong Yeh" wrote: Hi Rutger, Thank you very much for the detailed reply. I guess i do not need to worry about those salt-pepper dots? Would you recommend output laplacian norm and laplacian_weighted maps and go through the images for each data set? Any tips for realizing something really goes wrong when looking at the propagator anisotropy map? Best, Ping On Jan 22, 2018 6:55 PM, "Rutger Fick" wrote: > Hi Ping, > > In my experience, badly estimated voxels typically have super high > laplacian norm and very low estimated laplacian weight (lopt). > Looking at these results I would say things actually look pretty good! > > Getting the best results is always tricky finding a balance of optimally > regularizing: not fitting the noise but also not over-regularizing, which > is why the GCV option is nice. > But, in rare cases it does mess up. So, if you want to give the GCV a bit > less freedom to go low (to be on the safe side) you can increase the > minimum bound of the GCV optimization in line 2272 of the code. > > There's many ways to speed up the code I gave you if you want to put in > the effort ;-) Using parallel processing is not standardly implemented in > dipy, but maybe you can hack it somehow. > You can also set the laplacian_weight = 0.1 or something to avoid GCV, but > it won't make a huge difference. I only ever used this code to do research > - so speed was not really a concern. > > Anyway, hope this all helped! Let me know if everything works out, > > Best, > Rutger > > On 19 January 2018 at 22:03, Ping-Hong Yeh wrote: > >> Hi Rutger, >> >> Attached please find the snapshot of norm_of_laplacian_signal, lopt, >> and pa maps of the same data set i used earlier. >> >> BTW, is there a way to speed up the mapmri_pa processing? Will the OpenMP >> help? >> >> Thank you, >> >> ping >> >> On Fri, Jan 19, 2018 at 1:25 PM, Rutger Fick >> wrote: >> >>> Hi Ping, >>> >>> So far, so good. >>> In my opinion the TORTOISE PA reconstruction looks a bit >>> flat/overregularized - but then again I don't know what kind of >>> regularization they implemented for themselves. >>> The PA of the implementation I gave you seems to give more consistent >>> contrast for different tissue configurations - which is a good - but looks >>> like it under-regularizes in some individual voxels (the salt-pepper noise >>> in the PA/RTOP). >>> >>> To check if this is the case, can you show me the >>> mapfit_L.norm_of_laplacian_signal() and mapfit_L.lopt maps? >>> >>> Rutger >>> >>> >>> >>> >>> On 19 January 2018 at 17:43, Ping-Hong Yeh >>> wrote: >>> >>>> Hi Rutger, >>>> >>>> Just give you an update of the results (see the attached snapshots) >>>> using GCV weighted and Laplacian regularization for MAPMRI estimation. >>>> >>>> The other PA mapping was calculated using TORTOISE. I have also >>>> attached RTOP mapping calculated using DIPY with and without GCV >>>> weighted and Laplacian regularization. >>>> >>>> Comparing to the TORTOISE, PA values in the one using GCV weighted and >>>> Laplacian regularization method are relatively smaller, particularly >>>> over the regions with the less dense white matter. >>>> >>>> For RTOP images, I am not sure whether GCV weighted and Laplacian >>>> regularization method outperforms the one without using GCV weighted >>>> and Laplacian regularization. >>>> >>>> Any comments? >>>> Thank you, >>>> >>>> ping >>>> >>>> On Wed, Jan 17, 2018 at 7:48 PM, Rutger Fick >>>> wrote: >>>> >>>>> Hi Ping, >>>>> >>>>> If it's still running and gave only that error then probably it was >>>>> just a single voxel that failed and the rest is working. However, I >>>>> recommend you first try to fit a smaller dataset (just a few voxels or a >>>>> single slice) just to check the results make sense. >>>>> >>>>> I should mention that the code I gave you is slower than Dipy's public >>>>> version for reasons I won't get into, so don't worry if you have to wait >>>>> longer than before. >>>>> >>>>> Best, >>>>> Rutger >>>>> >>>>> On 18 Jan 2018 00:58, "Ping-Hong Yeh" wrote: >>>>> >>>>>> Hi Rutger, >>>>>> >>>>>> Thanks again for the prompt reply. >>>>>> >>>>>> Adding "mask" to mapmri have fixed the error; however, another error >>>>>> shows up, >>>>>> >>>>>> mapfit_L = map_model_L.fit(data,mask=data[..., 0]>0) >>>>>> dipy/core/geometry.py:129: RuntimeWarning: invalid value encountered >>>>>> in true_divide >>>>>> theta = np.arccos(z / r) >>>>>> dipy/reconst/mapmri_pa.py:364: UserWarning: The MAPMRI positivity >>>>>> constraint depends on CVXOPT (http://cvxopt.org/). CVXOPT is >>>>>> licensed under the GPL (see: http://cvxopt.org/copyright.html) and >>>>>> you may be subject to this license when using the positivity constraint. >>>>>> warn(w_s) >>>>>> dipy/reconst/mapmri_pa.py:413: UserWarning: Optimization did not find >>>>>> a solution >>>>>> warn('Optimization did not find a solution') >>>>>> Error: Couldn't find per display information >>>>>> >>>>>> >>>>>> It is still running though. Should i stop the running? >>>>>> >>>>>> Thank you. >>>>>> ping >>>>>> >>>>>> On Tue, Jan 16, 2018 at 7:18 PM, Rutger Fick >>>>>> wrote: >>>>>> >>>>>>> Hi Ping, >>>>>>> >>>>>>> Reading the error messages, it looks like you're fitting a masked >>>>>>> voxel. The following error: >>>>>>> >>>>>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:389: >>>>>>> RuntimeWarning: invalid value encountered in divide >>>>>>> data = np.asarray(data / data[self.gtab.b0s_mask].mean()) >>>>>>> >>>>>>> says you're dividing by either zero or NaN, which means your b0 >>>>>>> value of that voxel was zero (or you had no b0 values possibly). Note that >>>>>>> mapmri needs at least one b0 measurement. >>>>>>> I recommend you check if it works when you fit a voxel that you know >>>>>>> for sure is in white matter. If it works, you can do something like >>>>>>> map_model_L.fit(data, mask=data[..., 0]>0) to use a mask that only >>>>>>> fits if the first measured DWI is positive (assuming your first measurement >>>>>>> is a b0). >>>>>>> >>>>>>> Best, >>>>>>> Rutger >>>>>>> >>>>>>> >>>>>>> >>>>>>> On 16 January 2018 at 23:46, Ping-Hong Yeh >>>>>>> wrote: >>>>>>> >>>>>>>> Hi Rutger, >>>>>>>> >>>>>>>> I got an error running the map_model.fit using mapmri_pa. Here is >>>>>>>> the scripts i used, >>>>>>>> >>>>>>>> >>>>>>>> map_model_L = mapmri_pa.MapmriModel(gtab, radial_order=radial_order, >>>>>>>> laplacian_regularization=True, # >>>>>>>> this regularization enhances reproducibility of estimated q-space indices >>>>>>>> by imposing smoothness >>>>>>>> laplacian_weighting="GCV", # this >>>>>>>> makes it use generalized cross-validation to find the best regularization >>>>>>>> weight >>>>>>>> positivity_constraint=True) # this >>>>>>>> ensures the estimated PDF is positive >>>>>>>> >>>>>>>> mapfit_L = map_model_L.fit(data) >>>>>>>> >>>>>>>> , and the error message, >>>>>>>> >>>>>>>> >>>>>>>> /Library/Python/2.7/site-packages/dipy/core/geometry.py:129: >>>>>>>> RuntimeWarning: invalid value encountered in true_divide >>>>>>>> theta = np.arccos(z / r) >>>>>>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:364: >>>>>>>> UserWarning: The MAPMRI positivity constraint depends on CVXOPT (http: >>>>>>>> xopt.org/). CVXOPT is licensed under the GPL (see: >>>>>>>> http://cvxopt.org/copyright.html) and you may be subject to this >>>>>>>> license when using positivity constraint. >>>>>>>> warn(w_s) >>>>>>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:389: >>>>>>>> RuntimeWarning: invalid value encountered in divide >>>>>>>> data = np.asarray(data / data[self.gtab.b0s_mask].mean()) >>>>>>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:413: >>>>>>>> UserWarning: Optimization did not find a solution >>>>>>>> warn('Optimization did not find a solution') >>>>>>>> /Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py:444: >>>>>>>> UserWarning: Optimization did not find a solution >>>>>>>> warn('Optimization did not find a solution') >>>>>>>> Traceback (most recent call last): >>>>>>>> File "", line 1, in >>>>>>>> File "/Library/Python/2.7/site-packages/dipy/reconst/multi_voxel.py", >>>>>>>> line 33, in new_fit >>>>>>>> fit_array[ijk] = single_voxel_fit(self, data[ijk]) >>>>>>>> File "/Library/Python/2.7/site-packages/dipy/reconst/mapmri_pa.py", >>>>>>>> line 465, in fit >>>>>>>> coef_iso = coef_iso / sum(coef_iso * self.Bm_iso) >>>>>>>> UnboundLocalError: local variable 'coef_iso' referenced before >>>>>>>> assignment >>>>>>>> >>>>>>>> >>>>>>>> Any suggestions? >>>>>>>> >>>>>>>> Thank you. >>>>>>>> >>>>>>>> ping >>>>>>>> >>>>>>>> On Fri, Jan 12, 2018 at 6:24 PM, Rutger Fick >>>>>>> > wrote: >>>>>>>> >>>>>>>>> Hi Ping, >>>>>>>>> >>>>>>>>> Attached is the mapmri code that also has PA, just put it in the >>>>>>>>> dipy/reconst/ folder (where also the current mapmri.py file is) and run >>>>>>>>> "python setup.py install" from dipy's main folder. That should make it >>>>>>>>> usable in the same way as the current mapmri module. >>>>>>>>> Note that its based on an old implementation that still works with >>>>>>>>> the "cvxopt" optimizer package, so you'll have to install cvxopt to make it >>>>>>>>> run. >>>>>>>>> >>>>>>>>> I recommend you use the model with both laplacian regularization >>>>>>>>> and positivity constraint, this give the best results in general. >>>>>>>>> >>>>>>>>> from dipy.reconst import mapmri_pa >>>>>>>>> mapmod = mapmri_pa.MapmriModel(gtab, >>>>>>>>> laplacian_regularization=True, # >>>>>>>>> this regularization enhances reproducibility of estimated q-space indices >>>>>>>>> by imposing smoothness >>>>>>>>> laplacian_weighting="GCV", # this >>>>>>>>> makes it use generalized cross-validation to find the best regularization >>>>>>>>> weight >>>>>>>>> positivity_constraint=True) # this >>>>>>>>> ensures the estimated PDF is positive >>>>>>>>> mapfit = mapmod.fit(data) >>>>>>>>> pa = mapfit.pa() >>>>>>>>> >>>>>>>>> Aside from the original MAPMRI citation for Ozarslan et al. >>>>>>>>> (2013), note that the relevant citation for dipy's laplacian-regularized >>>>>>>>> MAP-MRI implementation is [1]. >>>>>>>>> [1] Fick, Rutger HJ, et al. "MAPL: Tissue microstructure >>>>>>>>> estimation using Laplacian-regularized MAP-MRI and its application to HCP >>>>>>>>> data." *NeuroImage* 134 (2016): 365-385. >>>>>>>>> >>>>>>>>> Hope it helps and let me know if you need anything else, >>>>>>>>> Rutger >>>>>>>>> >>>>>>>>> >>>>>>>>> On 12 January 2018 at 21:48, Ping-Hong Yeh >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> Hi Roger, >>>>>>>>>> >>>>>>>>>> Thanks for the prompt reply. >>>>>>>>>> May I have the code for estimating PA? >>>>>>>>>> >>>>>>>>>> Ping >>>>>>>>>> >>>>>>>>>> On Jan 12, 2018 3:21 PM, "Rutger Fick" >>>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>>> Hi Ping, >>>>>>>>>>> >>>>>>>>>>> MAPL is just a name for using laplacian-regularized MAP-MRI. If >>>>>>>>>>> you're using the dipy mapmri implementation then you're using MAPL by >>>>>>>>>>> default. >>>>>>>>>>> From a fitted mapmri model you can estimate overall >>>>>>>>>>> non-gaussianity using fitted_model.ng(), and parallel and perpendicular >>>>>>>>>>> non-Gaussianity using ng_parallel() and ng_perpendic >>>>>>>>>>> perpendicularular(). >>>>>>>>>>> Propagator Anisotropic is not included in the current dipy >>>>>>>>>>> implementation. However, I do have a personal version of dipy's mapmri >>>>>>>>>>> implementation that includes it, if you're interested. >>>>>>>>>>> >>>>>>>>>>> Best, >>>>>>>>>>> Rutger >>>>>>>>>>> >>>>>>>>>>> On 12 January 2018 at 16:49, Ping-Hong Yeh < >>>>>>>>>>> pinghongyeh at gmail.com> wrote: >>>>>>>>>>> >>>>>>>>>>>> Hi DIPY users, >>>>>>>>>>>> >>>>>>>>>>>> I would like to know the way of estimating non-Gaussian and >>>>>>>>>>>> PA, mentioned in the Avram et al. ?Clinical feasibility of >>>>>>>>>>>> using mean apparent propagator (MAP) MRI to characterize brain tissue >>>>>>>>>>>> microstructure? paper, using MAPMRI or MAPL model. >>>>>>>>>>>> >>>>>>>>>>>> Thank you. >>>>>>>>>>>> >>>>>>>>>>>> Ping >>>>>>>>>>>> >>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>> Neuroimaging mailing list >>>>>>>>>>>> Neuroimaging at python.org >>>>>>>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> _______________________________________________ >>>>>>>>>>> Neuroimaging mailing list >>>>>>>>>>> Neuroimaging at python.org >>>>>>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> _______________________________________________ >>>>>>>>>> Neuroimaging mailing list >>>>>>>>>> Neuroimaging at python.org >>>>>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Neuroimaging mailing list >>>>>>>>> Neuroimaging at python.org >>>>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Neuroimaging mailing list >>>>>>>> Neuroimaging at python.org >>>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Neuroimaging mailing list >>>>>>> Neuroimaging at python.org >>>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>>> >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Neuroimaging mailing list >>>>>> Neuroimaging at python.org >>>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>>> >>>>>> >>>>> _______________________________________________ >>>>> Neuroimaging mailing list >>>>> Neuroimaging at python.org >>>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Neuroimaging mailing list >>>> Neuroimaging at python.org >>>> https://mail.python.org/mailman/listinfo/neuroimaging >>>> >>>> >>> >>> _______________________________________________ >>> Neuroimaging mailing list >>> Neuroimaging at python.org >>> https://mail.python.org/mailman/listinfo/neuroimaging >>> >>> >> >> _______________________________________________ >> Neuroimaging mailing list >> Neuroimaging at python.org >> https://mail.python.org/mailman/listinfo/neuroimaging >> >> > > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > > _______________________________________________ Neuroimaging mailing list Neuroimaging at python.org https://mail.python.org/mailman/listinfo/neuroimaging -------------- next part -------------- An HTML attachment was scrubbed... URL: From sara.sedlar at gmail.com Wed Jan 24 07:02:58 2018 From: sara.sedlar at gmail.com (Sara Sedlar) Date: Wed, 24 Jan 2018 13:02:58 +0100 Subject: [Neuroimaging] [dipy] Problem with dipy.test() Message-ID: Hello, I've installed dipy library from source on Ubuntu 16.04. I have a problem when running dipy.test(). The following failure occurs: ====================================================================== FAIL: dipy.tracking.tests.test_utils.test_target_lb ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest self.test(*self.arg) File "/home/sara/Science/software/dipy/dipy/tracking/tests/test_utils.py", line 238, in test_target_lb _target(target_line_based, streamlines, (1, 1, 1), (2, 1, 1), False) File "/home/sara/Science/software/dipy/dipy/tracking/tests/test_utils.py", line 277, in _target assert_equal(len(new), 1) AssertionError: 2 != 1 ---------------------------------------------------------------------- Ran 651 tests in 415.243s FAILED (SKIP=21, failures=1) I've tried to run the function test_target_lb separately, and the AssertionError occurs from time to time, depending on the random initialization of the affine matrix. Could you please tell me if this failure can be ignored? Thank you, Best regards, Sara -------------- next part -------------- An HTML attachment was scrubbed... URL: From arokem at gmail.com Mon Jan 29 00:12:48 2018 From: arokem at gmail.com (Ariel Rokem) Date: Sun, 28 Jan 2018 21:12:48 -0800 Subject: [Neuroimaging] Neurohackademy: summer school in neuroimaging and data science, July 30th - August 10th, 2018 Message-ID: We are happy to announce a call for applications to participate in Neurohackademy 2018! This two-week hands-on workshop (formerly "Neurohackweek"), held at the University of Washington eScience Institute in Seattle, July 30th - August 10th, 2018, will focus on technologies used to analyze human neuroscience data, on methods used to extract information from large datasets of publicly available data (such as the Human Connectome Project, OpenfMRI, etc.), and on tools for making human neuroscience research open and reproducible. Neurohackademy sessions in the first week will include lectures and tutorials on data science, machine learning, data visualization and data resources. The second week will be devoted to participant-directed activities: guided work on team projects, hackathon sessions, and breakout sessions on topics of interest. Instructors include Deanna Barch, Eva Dyer, Fernando Perez, Russ Poldrack, Jake Vanderplas, Gael Varoquaux, Tor Wager, and Kirstie Whitaker, among others. *For more details, see: https://neurohackademy.github.io/ * We are now accepting applications to participate from trainees and researchers in different stages of their career (graduate students, postdocs, faculty, and research staff) at: https://form.jotform.com/80126067304145 Ideally, applicants should have some prior experience with neuroscience data analysis, but we welcome applications from participants with a variety of relevant backgrounds. Accepted applicants will be asked to pay a fee of $200 upon final registration. This fee will include participation in the course, accommodation in the UW dorms, and two meals a day (breakfast and lunch), for the duration of the course. A limited number of fee waivers and travel grants will be available. We encourage students with financial need and students from groups that are underrepresented in neuroimaging and data science to apply for these grants (see application form for details). *Important dates:* *March 19th: Application deadline* *April 5th: Notification of acceptance* *April 23rd: Final registration deadline* On behalf of the instructors, Ariel Rokem, University of Washington Tal Yarkoni, University of Texas, Austin -------------- next part -------------- An HTML attachment was scrubbed... URL: From J.Necus2 at newcastle.ac.uk Tue Jan 30 13:26:16 2018 From: J.Necus2 at newcastle.ac.uk (Joe Necus (PGR)) Date: Tue, 30 Jan 2018 18:26:16 +0000 Subject: [Neuroimaging] raw dMRI affine 'shearing' error References: Message-ID: Hi All, I noticed another post with somebody facing the same problem. When attempting fiber tracking I recieve the following error with all of my raw diffusion MRI images. I am not sure how to overcome this. Any help much appreciated. ValueError: The affine provided seems to contain shearing, data must be acquired or interpolated on a regular grid to be used with `LocalTracking`. Thanks a lot Joe -------------- next part -------------- An HTML attachment was scrubbed... URL: