     if typeof date == 'string' or date instanceof String
       # Reset the attribute to a date.
       obj[attr] = moment(date)
-
+  
   
 svcs.factory 'Chart', ->
   # Builds the nvd3 chart format for the given input resource

  # cached object image content data is not loaded until the image
  # object load() function is called.
  #
  # @param parent the ImageContainer scan or registration object
  # @returns the image objects
  imagesFor: (parent) ->
    cache(parent) or cache(parent, parent.files...)

  # Configures the modeling tables.
  configureTable: (sessions) ->
    sessionsWithChangeProperties = (sessions) ->
      # @param current the current modeling parameters
      # @param previous the previous modeling parameters
      # @returns the session objects extended to include
      #   the percent change properties for all but the
      #   first session
      addSessionChangeProperties = (current, previous) ->
        # @param current the current modeling parameters
        # @param previous the previous modeling parameters
        # @returns the percent change properties object
        extension = (current, previous) ->
          # @param current the current value
          # @param previous the previous value
          # @returns the percent change
          percent_change = (current, previous) ->
            (current - previous)/previous * 100
          
          # Return an object with the change properties.
          delta_k_trans_pct_change: percent_change(current.delta_k_trans, previous.delta_k_trans)
          fxl_k_trans_pct_change: percent_change(current.fxl_k_trans, previous.fxl_k_trans)
          fxr_k_trans_pct_change: percent_change(current.fxr_k_trans, previous.fxr_k_trans)
          v_e_pct_change: percent_change(current.v_e, previous.v_e)
          tau_i_pct_change: percent_change(current.tau_i, previous.tau_i)
        
        # If this is not the first session's modeling object,
        # then extend the object with the percent change properties,
        # otherwise, return the first modeling object unchanged. 
        if previous
          _.extend current, extension(current, previous)
        else
          current

      # The previous modeling object.
      prev = null
      # The modeling objects extended with change properties.
      result = []
      # Extend all but the first modeling object with change properties.
      for sess in sessions
        curr = sess.modeling
        if curr
          result.push addSessionChangeProperties(curr, prev)
          prev = curr
      # Return the result.
      result

    # Return the configuration object.
