Search This Blog

Sunday, May 4, 2014

Open DICOM dialog File Preview:  In Build 137, a defect became apparent when the preview of the DICOM file was all "white".  This is an "uninitialized memory type of error" and might have been presented differently on different systems.
Fixed the problem loading with the DICOM single file provided by Riccardo Lattanzi.
This is unconventional DICOM obtained as a result of image processing
Save RAW dialog box:  added a "state variable" so the last used extension is remembered and offered as a default choice next time when the dialog is opened.
Open RAW dialog box:  added a "state variable" so the last used extension is remembered and offered as a default choice next time when the dialog is opened.

Saturday, May 3, 2014

Fixed the ANALYZE file loading problem:  old legacy datatype=132 was present in the header. This is not a part of ANALYZE 7.5 implementation.  So it was added as legacy type and the file is loading now.

Thursday, May 1, 2014

Completely Re-engineering K-trans model with 3 parameters {K-trans,Ve,Va}...
Completely re-engineering the 2-parameter K-trans model  {K-trans,Ve}.  Will verify on the MR4D from the PET-MR exam...

Wednesday, April 30, 2014

Major work finished, re-enabling and verifying the Automatic Build Test after partial phaseout of 24-bit processing.

Tuesday, April 29, 2014

Zoom-to-Display functionality:  converting internal processing from 24-bit  to 32-bit for simplicity and speed.

Monday, April 28, 2014

MR4D (from combined PET-MR exam):
Verifying the "K-trans model" = {K-trans, Ve}.  Adding a corresponding subtest to ABT....
Registration defect  fixed:  while registering two longitudal MPRAGE images, the registration crashes if one of 3 measures is used:  {SignalDiff, CrossCorrelation, RatioUniformity}


Added the ABT subtest for  sag1.im<->sag4.im registration for 5 additional measures:
  {SignalDiff, CrossCorrelation, RatioUniformity,MI,MI-norm}

Fixed the volume overlay problem, when 2 brain volumes with the resolution difference around
1e-4 were not able to overlay.
PET-MR  registration:  Removing optional  "PET resolution\Best resolution" option as it always to the best resolution now due to the new codec.

Thursday, April 24, 2014

Verifying the ABT (automatic build test) due to the changes related to the NN-codec.
Providing the code to maintain the backward compatibility with the older FVX format, which has been updated with the new Codec.

Wednesday, April 23, 2014

Optimizing memory bandwidth around the single slice voxel CoDec.  Converting 24-bit based voxel  representation to 32-bits.

Tuesday, April 22, 2014

Fully coded,  Presently debugging the "NN-loseless codec"....  required for Hi-res  PET->MR registration.

Sunday, April 20, 2014

Implementing highly efficient internal volume codec that is targeting the volumes upsampled using the NN-interpolation.  This is a critical function during the PET-4D to MR registration.
User optimally desires best available resolution for both registered volume, which is typically a MR resolution.  However, for high timepoint # the resulting volumes might reach upto 7 GB  (compressed with the regular FireVoxel compression).
This new codec will allow much higher compression of such registered PET volumes.

It is lossless.
High-accuracy PET-to-MR registration using an approximate BrainMask with 4X speed gain.

Presently, it is very hard to achieve PET-to-MR registration without additional guidance.
From previous registration experience, a quick  Brain ROI was obtained using the BrainMask\EdgeWave tool.

This ROI is just an approximation of an anatomically precise mask of the brain. FireVoxel can obtained a much more precise BrainMask by adding the non-uniformity correction to that workflow.



After obtaining BrainMask ROI, the regular  PET-to-MR registration runs that uses ROI as a guidance.  Resulting registration has a very high accuracy.
The whole processing is less than 4 minutes on the reference ($1K) PC.










Single volume Edge-constrained smoothing:  partially combined the code with the similar logic of "Inter-volume constrained smoothing".  Reused the dialog common for both functions.

Corrected the logic for the Registration3D: TargetROI.  Included a new  dialog item that explicitly displays the name of the layer to be used as a Target ROI.
Implemented an initial variant of the "Inter-volume Edge Constrained Smoothing".  In this  test:
a) MR and PET4D were registered with very high accuracy.
b) MR-edges (as 3D surfaces) were detected using the texture-edge detector (URAL)
c) PET-volume was smoothed, with smoothing apperture that was constrained by the presence
of edges within vicinity of every voxel.

This just a prototype as many options are available.
Specialized dialog box was developed.

Implemented the two-compartment Sokoloff'77 model (long formula) also used in Reivich'85. Results are identical (to 0.01% precision) with the Sokoloff'79 interpretation (short formula)
in the initial tests.

Sunday, April 13, 2014

PET:  Latest version of the IDIF.  User does NOT have to specify the dominant direction anymore.  Also the meaning of the seed is changed - User just have to place the center of the seed on the vessel.  Other parameters, such as max vessel length, are enabled.





Added L1/L2 optional residual metric to  Sokoloff'79 (short) model.
Completely re-enginered the Sokoloff-79 model (as in Wai's implementation = short formula).

a) Enabling the analytic integration, instead of PWL-functions.  This also eliminates the need for the 1-sec upsampling of the TAC data used in the old version.

b) More streamlined and corrected implementation of the Ta-arterial delay.



Re-enabled ABT subtest for the "Liver DCDI-standard model"

Saturday, April 12, 2014

Dynamic Experiment module (Parametric maps) flow:  correcting a significant inefficiency of dealing with the Void voxels (as in  "Process ROI only"  mode).  Entirely reengineered a parallel processing structure for the Voxelwise parametric map, especially for "ROI only" mode.

Friday, April 11, 2014

Liver DCDI model defect:  when voxelwise map (over the ROI) is requested calculation "hangs" and performance monitor shows only a single core loaded.


Thursday, April 10, 2014

ABT: added an automatic subtest for PET4D to MR4D registration, with several layers each, to Best Resolution option.
ABT:   adding automatic subtest for   PET4D<->MR4D multilayer registration.

Wednesday, April 9, 2014

ABT:  adding the "WM lesions \FLAIR"  segmentation to the automatic build test.
Also the corresponding dialog for "WM lesions \FLAIR"  parameters is automatically tested by Open\Close.
IDIF function:  "Keep high filter" is an effective way to reduce partial volume voxel effect and deviation outside the vessel.  This is an example on Aorta (Liver DCDI dataset)


Red ROI:  All the preliminary voxels were kept  (Keep high signal=1)
Blue ROI:  Only highest half of the voxels was kept.
Automatic Build Test:  adding the IDIF (vessel segmentation) subtest.
Also the corresponding dialog for IDIF parameters is automatically tested by Open\Close.
Automatic IDIF (input function):  added an option to restrict the length of the vessel from the start point. This is requested by all the users of this functionality.



Unconstrained-length segmentation    vs.    15mm-constrained segmentation.

Sunday, April 6, 2014

Updated the IDIF user interface and algorithm:
a) Adding a drop down combo box where user can select the direction {X,Y,Z} of the Vessel.
b) Adding an experimental option {Auto} for the direction of the vessel.  In this mode, all 3 directions will be checked and the largest (by voxel count) resulting vessel would be selected.

New features seem to provide a substantial improvement in usability and quality of the result. F.e. in liver, we would like to always work in Axial projection where the Portal Vein direction is often along {X,Y} axis.














So in new version, user does not have to choose the direction of the vessel.  So for portal vein the "Auto" direction is set by default.

Another change is that the seed does not have to cover the vessel.  Instead, it is only assumed that the center of the seed should be very close to the vessel in question.

Provided a basic documentation for Liver DCDI registration workflow.

Saturday, April 5, 2014

Corrected defect:  In all 3D registrations 2 documents should be present.  The selected document is used as a Target of the registration.  However, if more than 2 document are present, the selection of Source document is sometimes incorrect.  Now the warning would be issued when more than one possible Source document is present.
Added new UI function:   "MainMenu>Volume>Crop4D - Current dynamic point only"
Fixed the defect of gross misregistration in liver DCDI exam.  New default setting for all parameters were explored and set.  All the gross misregistration cases are fixed. Results are not stellar, but for large proportion of timepoint the movement across the axial plane is greatly reduce.
Further work will be done as needed but result is good enough for now.

Friday, April 4, 2014

Defect corrected: when 3D volume is converted to 4D using the "MainMenu>Volume>Convert 3D to 4D" function, dynamic information (such a timepoints) is not set properly in the new volume.
Developing UI function:   " MainMenu>Volume>Crop timepoints".  This function takes 4D volume.
User specify comma-deliniated set of timepoints such as "1,3,5,7".  Function outputs another 4D volume containing only the specified timepoints. This is a very important function for troubleshooting the 4D registration.

Thursday, April 3, 2014

FireVoxel Build 135B is released.
Real Valued volumes (such as PET and parametric maps):  fixed defect when after the cropping such volumes where transformed into the Integer Volume class.
Dialog  Registration 3D\4D:
Further simplified and compacted by conveniently grouping the translation fields in the AutoFocus panel.

PET-to-MR registration:  Achieved a very good registration result on the difficult case "MG".  Problem was that PET image was rotated by 12 degrees with the respect to MR just in one axis Z.
Default registration parameters were "widened" to accommodate such enormous displacements. Also switch default registration measure from MI (mutual info) to URAL (gradients).


Wednesday, April 2, 2014

Enabled the following User Interface-level functions for PET volumes:
a) Advance to the timepoint of Max Info
b) Optimize ViewFilter setting for the current timepoint
Continue to simplify code in numerous locations due to inclusion of the DIM3D field into the FRAME structure.
Small fixes related to the PET4D<->MR4D registration.  Build 135A is released.
FireVoxel Build 135 is released.
Finalized the algorithm and User interface for the 2 way "PET register to Anatomy" function.
Presently, {PET3D,PET4D}<->{MR3D,MR4D} can be registered. If both source and target are 4D user is given a choice for which one to keep in 4D.

All the additional layers (such as ROIs) are transformed properly.

Tuesday, April 1, 2014

Restoring the Automatic Build Test as it presently crashes. This is routine after substantial code changes.
Optimized API calls (remover the AddLayerByCrop\LoadDocumentByCrop) for document\layer loading.
Parallelized the internal DICOM header creation.

Monday, March 31, 2014

PET4D+ROIs  registration to MRI4D+ROIs is finished.  When timelines are merged, new 4D volumes created for the merged timeline.  This results in substantial memory overhead at the moment. Implementing the design for efficient memory handling when the redundant timepoints are present.

Sunday, March 30, 2014

Paralellized the  "Crop Out void voxels from Volume" function (part of the registration).

Friday, March 28, 2014

Sokoloff model, as in Sokoloff-Phelps paper (Annals of Neurology 1979, vol.6 No. 5) is

This  is the formula that was used by Dr. Wai Tsui (Mony's team). He sets k4=0.   So after that the expression could be rewritten:  alpha1 = 0,  alpha2 = k2+k3

This is exactly the formula used by Wai and is presently in FireVoxel Build 134 (the Anne was using for the abstract).

Now there is a second paper by Reivich (Journal of Cerebral Blood flow and Metabolism 5:179-192 1985), brought up by Fernando.  This paper references an earlier (Sokoloff 1977) paper: with


However, those 2 formulas are substantially different, which can be the easiest observe if we substitute k2=0 to both.  So which one should I use?





Fixing defect, when the 4D volume crop, the absolute values of times are lost and relative times are preserved.  This causes the problem for some registration functions.

Thursday, March 27, 2014

Implemented functionality in "PET to Anatomy registration" when all of the MR entity layer (incl. ROIs) are transformed appropriately.  This realizes the "ROI Transfer" feature.  PET entity layers, if present,  are transformed appropriately too.

Wednesday, March 26, 2014

Impementing 4D to 4D registration in the context of the PET to Anatomy registration. The challenge here is to properly merge the different timings of PET and MR.

Monday, March 24, 2014

FireVoxel Build 134 is released.
Fixed defect and crash:  Dialog RoiStats4D, in multilayer entity, if there are several ROIs present and if one of them is empty, no stats would be displayed even if it was not an active ROI.
Finalized the Release Candidate for Liver DCDI model. All the concentration options discussed are included. This would appear in Build 134.

Thursday, March 20, 2014

Liver DCDI:  revisiting the Monotail concept (AIF=VIF with t>3 min).  This might allow to perform a segmented fir for {F,Ve} only for this part of the curve thus stabilizing the kit.  This does not make any assumptions about the delays {Ta,Tv}, i.e. would work for any delays. Interestingly, Ki also can be derived as it is not an independent variable of in the trio of {F,Ve,Ki}

Wednesday, March 19, 2014

DCDI model:  added an User Interface option to select Linear (=1) or Logarithmic(=0) concentration conversion.
FireVoxel Build 133 is released.
DCDI model:  added an User Interface option to use the L1 or L2 metric for calculating the
fitness residual.
YL-case,   "DCDI - Stabilized V1"

Obtained a good fit with good parameter values except for the high flow. Perhaps high flow can be explained by the concentration conversion.
Note1:  ROI was drawn fairly large as in Sourbron's paper (i.e. 40-60 mm diameter)
Note2:  As in Sourbron's paper the Arterial delay exceeds the Venous delay.  Interestingly that would
mean that venous contrast arrives first, but this is exactly his primary mode.

Tuesday, March 18, 2014

Implemented automatic matching BATs of AIF and TACs. Result is inconclusive as fitting is very good but parameters are unrealistic.
Corrected the VolSetSlice function, in the binary (1-bit ROI) case.  The Source buffer was modified in this function causing the error.
New DCDI variant:   after BATs are matched, the arterial flow Fa can be calculated from the short initial period.

Monday, March 17, 2014

FireVoxel Build 132D is released.  This fixes the problem with MTT in the "DCDI  Stabilized-V1" model.

Sunday, March 16, 2014

Dialog RoiStats4D: added a function button-"BAT". When user press this button the current time advances to the BAT for this curve.
Developing an automatic  BAT (bolus arrival time) function for dynamic studies.  At the moment it will be employed in the context of DCDI model:   BAT of AIF should be matched to BAT of ROI to determine the Arterial delay specific to the given ROI.
Quick FireVoxel Builds 132B, 132C are released reflecting the urgent work on the stabilization of the Liver DCDI (Dual compartment dual input models).
Particularly, in 132C, a "DCDI Stabilized - V1" is introduce.  It uses the integral form of DCDI equation to eliminate one of the independent optimization variables thus stabilizing the fit.

Friday, March 14, 2014

Implementing the "Liver DCDI  Monotail" model that allows to avoid an explicit calculation of {Ta,Tv} (arterial and venous delay).  As the first stage only 3 parameters are calculated {F,Ve,Ki}.
FireVoxel Build 132A is released.

Thursday, March 13, 2014

Investigating defect of Saving\Loading RAW  (*.im\MIDAS) files.
Liver DCDI model:   removed the "Ve max" (extracellular volume limit) from the user interface since it is always in [0,1] range.

Wednesday, March 12, 2014

Dialog RoiStats4D:  added the Info button so the Information could be displayed more conveniently for the user.
Dialog RoiStats4D:   Implemented an intelligent background color management.
Dialog RoiStats4D:  User is now able to use   {LEFT,RIGHT} keyboard keys to scroll in time when this dialog is open.  The 4D volume and the Curves in the dialog box are updated correspondingly.

Among many uses this function allows to reuse this dialog in the BAT (Bolus Arrival Time)  verification procedure.
Fixed several issues related to 4D ROIs and the corresponding layer control dialog box:
a) 4D ROI default name RAW extension
b) 4D ROI default RAW save format
c) In RoiStat4D dialog box, the timepoints not containing the actual ROI are drawn as "white" nodes on the curve.

Monday, March 10, 2014

Liver DCDI model:  adding two implementations of this model to the UI. 
The "Standard" variant, has exact implementation of the Sourbron's paper with the addition of the Exam length parameter and the variables {TotalFlow,fa,Ve,ki}.
The "Experimental" variant hosts new investigations, such as independently derived "Ta" arterial delay time.
Fixed the defect in   "Roi>Convert 3D to 4D" function.  DICOM-style headers were not properly constructed for a newly created 4D entity.

Sunday, March 9, 2014

URAL registration 3D/4D:   in case when non-textured URAL measure is selected, applied very efficient gradient interpolation technique that result in a significant speed up during the AutoFocus and especially the Finetune stage.

Completely re-engineered the image gradient field reslicing function.

Saturday, March 8, 2014

Registration 4D:   Eliminated an excessive temporary memory allocation during the 4D registration.  This was the cause of the memory allocation failure during the registration of large 4D datasets.

Friday, March 7, 2014

Latest DCDI approach to  Arterial (Ta) and Venous (Tv) delay approach   was tested:

Arterial delay is defined graphically (at the moment) by analyzing the AIF and  roiTAC.
(blue-AIF,  red-VIF, green-roiTAC)

Define:   Ta = ContrastArrivalTimeROI - ContrastArrivalAIF.
For this specific ROI it was Ta = 16 sec.
At the moment User punches in this time delay, but will be entirely automatic later.

Then we perform 5 parameter fitting of DCDI model  {TotalFlow,fa,Ki,Ve,Tv}.  We set  Tv=[0,8] seconds.

Result is encouraging, with fa=0.33.  (Blue is the data curve, black is the Model curve)


ROI was made very small to avoid the blood vessels.

Thursday, March 6, 2014

Time to Peak  (in seconds) parametric map for the liver  , case YL.
Vein network shows varying arrival times.  There seem to be a substantial delay between the main Portal Vein (where we sample VIF) and the peripheral (?) branches (which actually supply the tissue).
Delays seem to be upto 15 seconds.


Liver DCDI:  Based on the discussion with Dr. Rusinek, experimenting with the alternative ways to calculate the Arterial fraction and then substitute it into the Sourbron's equation for fitting.  Reminds me of "Segmented fit" in IVIM promoted by Eric Sigmund.

Tuesday, March 4, 2014

Stress testing correctness of the fitting procedure, substituting  AIF and VIF (in 2 separate experiments) as the Data curve and comparing to the analytically derived result.
Assembled {AIF,VIF,+6 ROI Tacs} package for the external verification of Liver DCDI model fitting.

Monday, March 3, 2014

Adding the allowed ranges of parameters {Fa,Fv,Ve,Ki} for Liver DCDI model, so the User\Researcher could control those parameters directly for investigations.
Provided to Hersh the full analysis \report on 3 cases   {KA,LP,YL} with the respect to Liver DCDI model.

Sunday, March 2, 2014

Friday, February 28, 2014

Liver DCDI model:  Obtained a very good fit, with all parameter values are now in the allowd physiological ranges.  However, the question remains why the Arterial Fraction is essentially a 0?  Does it have an explanation?
ROI to model, was made very small with the effort to exclude possible blood vessels.


Thursday, February 27, 2014

Rewriting the Liver DCDI fit procedure, so the Amoeba optimization is performed many times from various starts in the grid, instead of a single start.
Implemented variant of Amoeba-local optimization that is guaranteed to stay within User-specified parameter bounds.  Applied it to the problematic liver case from Hersh. However, the obtained fit is not as good as for other cases, so continue the work on more efficient optimization procedure.  Here is current best result:


Further investigation of the fitting problems on Hersh's example:  very good fit is found by Amoeba,  but the best value is found is outside the acceptable physical range of parameters (f.e. the Arterial fraction is negative).  So clearly the Optimization procedure has to change in some way.  Investigations to continue.


Wednesday, February 26, 2014

Investigating and fixing what most likely a defect in the fitting of the DCDI model.  Issue is that two curves below, one with obviously worse fit is presently returned with the smaller residual.